How can I plot 2D temperature.
6 ビュー (過去 30 日間)
古いコメントを表示
Hey, I have a matrix of the temperature from the geometry that is an circle.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166541/image.png)
I would like to know how can I plot it?
I am adding one image that looks like the result that I expect.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166542/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166543/image.jpeg)
0 件のコメント
採用された回答
Star Strider
2017 年 8 月 4 日
Without your data or calculations, providing specific code is not possible.
You may have to calculate your data in polar coordinates, then transform them to Cartesian coordinates to plot them with the contourf function.
See if something like this does what you want:
a = linspace(0, 2*pi, 500);
r = sin(a).^2;
[A,R] = meshgrid(a,r);
Z = R .* sqrt(A);
[X,Y,Z] = pol2cart(A,R,Z);
figure(1)
contourf(X, Y, Z)
grid on
axis equal
2 件のコメント
Star Strider
2017 年 8 月 5 日
If the angle goes from 0 to 2*pi in 52 steps, you can define the angle as:
a = linspace(0, 2*pi, 52);
After that, the radius and temperature are defined. You may not be able to use the contour or contourf functions with scalar data, because those functions require that the ‘z’ value be a matrix, and yours are a vector.
I am not certain what to suggest.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Polar Plots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!