Need help with a forloop..

Thread Starter

Judas543

Joined Jan 26, 2010
60
Use a “for” loop to create a vector with nth element 1+(-1)n+1/(2n+1), and plot it for n=1 to n=10. Label the x-axis “frequency (w)” and the y-axis “phase (f)”. To get “w” use “\omega”; how do you think you get f?
 

johndoe45

Joined Jan 30, 2010
364
i'm guessing he just wants you to make the loop

n=1:10;
for i=1:length(n)
v(i)=1-n(i)+1/(2*n(i)+1)
end
plot(n,v)
xlabel('frequency (\omega)')
ylabel('phase (f)')
 
Top