I understood now, the question is not clear. The below image was in my mind when I asked the qiestion. Lets say for Theta= o line we have the set of value or sin function from the for loop. I wanted to expand the same value of sin(r) for theta 0 to 360 continousely. I'm showing only 4 theta position in the image. I'm aware its not going to be a simple code. I wanted have some input from others too.
How to use 2 variable in for loop?
1 回表示 (過去 30 日間)
古いコメントを表示
I want to use 2 variable in for loop. If we consider a circle then in polar coordinate I've already used r variable. Now I want to consider theta too. For eg.
i = 360;
for j =1:i
n = 1.5 ;
th(j) = j*pi/180 ;
X(j) = sin(th(j)) ;
end
figure(1)
plot(th*180/pi,X)
It give me a 1D line. Let us say for theta = 0. I want the whole range of theta from 0 to 360 to make it a 2D plot. How do I do that?
採用された回答
U B
2022 年 8 月 21 日
1 件のコメント
Star Strider
2022 年 8 月 21 日
If you want help on something in the future, ask the actual question you want an answer to.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!