plotting loop values in matlab

Status
Not open for further replies.

rameshrai

Full Member level 3
Joined
Aug 16, 2010
Messages
158
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,298
appliedelectronicsengineering.blogspot.com
Activity points
2,272
Hi,

Can anybody help me in this? How do I plot loop values in matlab, for example I have-

Code:
for k =1:N

p(k) = ?
x(k) = some function of p(K)

end

plot(p,x)

p(k) should take values 0 to 1 in increment 1/N.

eg- when k= 1, p(1)=0, when k =2, p(2)= p(1)+1/N, when k =3, p(3) = p(2)+1/N and so on and then get graph.

I hope it is understandable what i am trying to say.

thanks
 
Last edited:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…