how to make polar plot with N x M matrix

2 ビュー (過去 30 日間)
shuki firuz
shuki firuz 2022 年 6 月 10 日
コメント済み: shuki firuz 2022 年 6 月 10 日
I have a matrix N x M where the r cordinate length is N and the theta cordinate length is M.
I am trying to make surfac polar plot with colour bar but I dont want it to be 3d plot.
I am having hard time doing it.
thank for the helpers!
a=2/3; %ft
h = 1e-3; %step
r = [0:h:a]; % r axis
theta = [0:h:2*pi]; % theta axis
N = length(r);
M = length(theta);
% also I have T matrix N x M calculated

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2022 年 6 月 10 日
編集済み: Bjorn Gustavsson 2022 年 6 月 10 日
You can have a look at these file-exchange contributions: pcolor-in-polar-coordinates, perfect-polar-plots, 3d-polar-plot.
Or you could (first step perhaps) do it with surf/pcolor:
[r2d,theta2d] = meshgrid(r,theta);
surf(r2d.*cos(theta2d),r2d.*sin(theta2d),YourMatrix)
shading flat % my personal preference
You might have to change order in and out of meshgrid or transpose YourMatrix.
HTH
  3 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2022 年 6 月 10 日
Good, happy that it helped.
In order to get the polar format axis I suggest you have a look at the file-exchange tools I linked to. Either to use as they are or to learn how they achieve that.
shuki firuz
shuki firuz 2022 年 6 月 10 日
I did and it was helpful
thank you

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

その他の回答 (0 件)

カテゴリ

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