# Create an array for θ from 0 to 2π with 1000 elements and generate a graph showing sin(nθ) for n=1, 2, … 5, all on a polar plot using an M-file. Include a legend and for each graph use a different line specification (colour).

76 views (last 30 days)
rami sammak on 4 Dec 2016
Answered: Tamir Suliman on 4 Dec 2016
how can i Create an array for θ from 0 to 2π with 1000 elements and generate a graph showing sin(nθ) for n=1, 2, … 5, all on a polar plot using an M-file. Include a legend and for each graph use a different line specification (colour).
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Answers (1)

Tamir Suliman on 4 Dec 2016
th = linspace(0,2*pi,1000) ;
n = 1:5 ;
y = zeros(length(n),1000) ;
for i = 1:length(n)
y(i,:) = sin(n(i)*th) ;
end
plot(th,y)
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Categories

Find more on Scatter Plots in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!