My data works when I plot it with contourf(X,Y,z) but when I try to plot it as contourf(X, Y, z,'Parent',HG) it's just blank and I have no idea why.
I have attached the X,Y,z data. I'm trying to do exactly as it says in that comment, it's exactly what I need but my contour just seems to be blank
Actually it seems like it goes blank when I try to rotate it? i have no idea anymore

 採用された回答

Shubham Rawat
Shubham Rawat 2021 年 3 月 17 日

0 投票

Hi,
I had found that we cannot use makehgtform in non-square matrices. So, you are not able to produce results.
HG.Matrix = makehgtform('xrotate', pi/2);
Whereas in that example he is using a square matrix to transform.
To produces results for xy, yz and zx plane. You may use contourf() function with different alignments of parameters, i.e.
load('matlab.mat');
contourf(X,Y,z); %for XY plane
contourf(Y,z,X); %for YZ plane
contourf(X,z,Y); %for Xz plane
Hope this helps!

1 件のコメント

metrize
metrize 2021 年 3 月 17 日
編集済み: metrize 2021 年 3 月 17 日
Can I put my data in square matrix form instead by extending it? Can you provide guidance on how? i.e. making z values 0 for the rest of the matrix to make a 173x173 matrix?
Edit: I tried with z(173,114:173)=0 but I still cannot rotate it even though it is square, can you provide any advice?

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

その他の回答 (0 件)

カテゴリ

製品

質問済み:

2021 年 2 月 25 日

編集済み:

2021 年 3 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by