From: Danna on
how can i substitude length in this code, I tried with i=-2*pi:0.01:2*pi; but it doesnt work

t=-2*pi:0.01:2*pi;
x=10*2+(cos(t));
y = sin(10*t);
for i=1:length(t)
hold on
plot(x(i),y(i),'*m')
axis([19 21 -1 1])
pause(.01)
end
From: Gautham Prasad on
"Danna " <silver_girl(a)hotmail.com> wrote in message <i2lqlc$oll$1(a)fred.mathworks.com>...
> how can i substitude length in this code, I tried with i=-2*pi:0.01:2*pi; but it doesnt work
>
> t=-2*pi:0.01:2*pi;
> x=10*2+(cos(t));
> y = sin(10*t);
> for i=1:length(t)
> hold on
> plot(x(i),y(i),'*m')
> axis([19 21 -1 1])
> pause(.01)
> end


ya what u did wont work for sure.
the length is (upper limit - lower limit)/step.
so in this case its, 4*pi/0.01
From: Gautham Prasad on
"Danna " <silver_girl(a)hotmail.com> wrote in message <i2lqlc$oll$1(a)fred.mathworks.com>...
> how can i substitude length in this code, I tried with i=-2*pi:0.01:2*pi; but it doesnt work
>
> t=-2*pi:0.01:2*pi;
> x=10*2+(cos(t));
> y = sin(10*t);
> for i=1:length(t)
> hold on
> plot(x(i),y(i),'*m')
> axis([19 21 -1 1])
> pause(.01)
> end


replace length(t) by the formula :
(upper limit - lower limit) / step.
in this case it is, 4*pi/0.01

regards,
gautham
From: Steven_Lord on


"Danna " <silver_girl(a)hotmail.com> wrote in message
news:i2lqlc$oll$1(a)fred.mathworks.com...
> how can i substitude length in this code,

Substitute length with _what_?

> I tried with i=-2*pi:0.01:2*pi; but it doesnt work
>
> t=-2*pi:0.01:2*pi;
> x=10*2+(cos(t));
> y = sin(10*t);
> for i=1:length(t)
> hold on
> plot(x(i),y(i),'*m')
> axis([19 21 -1 1])
> pause(.01)
> end

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

From: Danna on
"Steven_Lord" <slord(a)mathworks.com> wrote in message <i2mq4s$es$1(a)fred.mathworks.com>...
>
>
> "Danna " <silver_girl(a)hotmail.com> wrote in message
> news:i2lqlc$oll$1(a)fred.mathworks.com...
> > how can i substitude length in this code,
>
> Substitute length with _what_?
>
> > I tried with i=-2*pi:0.01:2*pi; but it doesnt work
> >
> > t=-2*pi:0.01:2*pi;
> > x=10*2+(cos(t));
> > y = sin(10*t);
> > for i=1:length(t)
> > hold on
> > plot(x(i),y(i),'*m')
> > axis([19 21 -1 1])
> > pause(.01)
> > end
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

thank you!!!