Hi,
I am running this code:
y1 = 0:.01:1;for y2=0:1/10:1;l=1+y2*10;t(:,l) = y1.^3./12 + (y1.^2.*y2)/4 - y1.^2./2 + (y1.*y2.^2)/4 - y1.*y2 + y1 - (7.*y2.^3)/12 + (3.*y2.^2)/2 - y2;endplot(y1,t)
and get this error:
Subscript indices must either be real positive integers or logicals.
However when I run this code:
y1 = 0:.01:1;for y2=0:1/10:0.5;l=1+y2*10;t(:,l) = y1.^3./12 + (y1.^2.*y2)/4 - y1.^2./2 + (y1.*y2.^2)/4 - y1.*y2 + y1 - (7.*y2.^3)/12 + (3.*y2.^2)/2 - y2;endplot(y1,t)
There is no problem! (only difference is the 3rd line)
Can someone explain why I cannot do the first one?
Best,
David
Best Answer