Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: regarding for loop
Replies: 3   Last Post: Nov 7, 2009 1:22 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ana

Posts: 9
Registered: 11/3/09
regarding for loop
Posted: Nov 6, 2009 2:19 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

hi there,

I have a question regarding this for loop;
x = 0;
f1 = 100e03;
alpha = 0.055;
for t = 0:0.1:20,
x = (exp(-alpha*t))*(cos((2*pi*f1*t)));
plot(t,x)
end

Note that if i do x(t)=... then i will have the error of;??? Subscript indices must either be real positive integers or logicals.

Why is it that I have no errors but he image is still not being plotted, well infact when i enter variable t it is just one value and even x, so I guess that s why...I just cannot see what i have wrong.. thanks alot for the help.

regards,
Ana



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2009. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Goodwin College of Professional Studies.