How do I plot Rosette-like diagram in this case?

5 ビュー (過去 30 日間)
HyoJae Lee
HyoJae Lee 2023 年 1 月 31 日
コメント済み: HyoJae Lee 2023 年 1 月 31 日
Hello,
I have matrix like this
data=[10 10 30 100;
20 50 70 150;
30 45 60 120;]
First column is time (sec), second column is starting angle (in degree), thrid one is final angle (in degree) and fourth one is length (cm).
Just using first row of the data, for example, I want to plot like following figure.
(I put some texts just for an explanation.)
I want just that red arc which 1) starts with starting anlge, 2) ends with final angle, and 3) is as long as length.
So, the final plot might be smiliar with Rosette-like diagram that have some stacked arcs with time.
Thanks,
Hyojae

採用された回答

Alan Stevens
Alan Stevens 2023 年 1 月 31 日
Something like this?
data=[10 10 30 100;
20 50 70 150;
30 45 60 120];
theta0 = deg2rad(data(:,2));
thetaf = deg2rad(data(:,3));
r = data(:,4);
for i = 1:3
dtheta = (thetaf(i) - theta0(i))/20;
th = theta0(i):dtheta:thetaf(i);
x = r(i)*cos(th);
y = r(i)*sin(th);
plot(x,y)
hold on
end
axis equal
  1 件のコメント
HyoJae Lee
HyoJae Lee 2023 年 1 月 31 日
It works!
Appreciated, Alan!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by