Contourf Z must be at least a 2x2 matrix error

8 ビュー (過去 30 日間)
mehtap agirsoy
mehtap agirsoy 2021 年 8 月 23 日
回答済み: Walter Roberson 2021 年 8 月 23 日
Hi all,while creating contourf plot I have Z must be at least a 2x2 matrix.I couldn't fix it. If you've any idea to fix it I'd be appreciate.Thanks in advance.
  1 件のコメント
KSSV
KSSV 2021 年 8 月 23 日
Unrecognized function or variable 'SPODpost'.
Error in Rainbow_POD (line 26)
mode = SPODpost(a(:,1:idx));

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

採用された回答

Walter Roberson
Walter Roberson 2021 年 8 月 23 日
mode = SPODpost(a(:,1:idx));
That function was not included
contourf(X,Y,Vi(:,:,mode(idx).ind(2)),10,'edgecolor','none')
For that to be valid, Vi(:,:,mode(idx).ind(2)) must be a 2D array. But...
>> whos -file POD.mat
Name Size Bytes Class Attributes
U 1x101 808 double
V 1x101 808 double
X 1x101 808 double
Y 1x101 808 double
and
% Ui,Vi,Wi,... :POD modes (spatial modes). Number of output modes depends
% on the number input velocity components. The dimension of
% the output data is the same as the input data, whereas the
% last dimension contains individual modes instead of
% snapshots.
The input V is a vector, and with the output Vi being the same size as the inputs, that means that Vi must be a vector.
Your plotting code with contourf() assumes that Vi is 3 dimensional, but it is only a vector.
You will not be able to do contouring in this situation.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by