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).

15 ビュー (過去 30 日間)
rami sammak
rami sammak 2016 年 12 月 4 日
回答済み: Tamir Suliman 2016 年 12 月 4 日
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).

回答 (1 件)

Tamir Suliman
Tamir Suliman 2016 年 12 月 4 日
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)

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by