0

i have the following code:

 I=0;
 L=0;
for i=1:20

   m=[I;L];
   hold on
   plot(1:20,m(1:2),'*');

   I=I+1;
   L=5+I;
end

The purpose of this code is in the beggining of each one of the 20 iterations, the table m, to change the values. after this part i want to print the I,L with different plot in the same figure.After that there is code which change again the values of I,L,M. The result i want to be a plot for each one of the I,L.But i don't know how to do this. Any ideas?

2
  • You want to have a plot with all the data overlaid on top of each other, and a plot for each individual set of data? Commented Mar 5, 2012 at 14:22
  • i want to have two different plots.one for the values of I and one for the values of L. the yaxis it will be the values (of I and L) and the xaxis it will be 1:20. for example the value of I in the first iteration is 100, so my point is (1,100) the next point (2,110) etc. Commented Mar 5, 2012 at 14:29

1 Answer 1

1

Do you mean something like that?

 I_value=0;
 L_value=0;
 I = [];
 L = [];
 for i=1:20
     I_value = I_value + 1;
     L=[5,I];
     I=[I,I_value+1];
 end

 figure;
 plot([I;L]','*');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.