Gibson486
Lifer
I have an assignment to plot a cirlce in matlab using loops, one using "for", the other using "while".
First, i know i have to use sin. However, i am confused trying to figure out what to use the trig function with. ALso, when making the loop, I know i need to tell matlab to stop at a certain point, therefore, do i need to to assign some sort of threshold? i guess we do this by saying
For x= sin(a)
0<a<pi/2
plot(x)
for x=sin(b)
pi/2<b<pi
plot(x)
for x=sin(c)
pi<c<3*pi/4
plot(x)
for x=sin(d)
3*pi/4<d<2*pi
plot(x)
end
do i atleast have the right idea?
First, i know i have to use sin. However, i am confused trying to figure out what to use the trig function with. ALso, when making the loop, I know i need to tell matlab to stop at a certain point, therefore, do i need to to assign some sort of threshold? i guess we do this by saying
For x= sin(a)
0<a<pi/2
plot(x)
for x=sin(b)
pi/2<b<pi
plot(x)
for x=sin(c)
pi<c<3*pi/4
plot(x)
for x=sin(d)
3*pi/4<d<2*pi
plot(x)
end
do i atleast have the right idea?