# plotting loop values in matlab

Status
Not open for further replies.

#### rameshrai

##### Full Member level 3
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.