Making a contour map using a 3D matrix

10 ビュー (過去 30 日間)
Bugce Gokce
Bugce Gokce 2020 年 6 月 11 日
コメント済み: Bugce Gokce 2020 年 6 月 11 日
i have 3d matrix. this matrix size is 247x3x96.
247 means total point number.
3 means point of latitude longitude and precipitation value of this point.
96 means epoch(so every 15 minutes during the day (a total of 96) I have a precipitation value for the relevant points.).
I want to draw a contour precipitation map for each epoch using the data of this matrix. (Or if I need to rearrange the matrix for this purpose, how should I do it? then how should I draw the contour map)
how can i do this?, i'm waiting for your help!
------------------------------------------------------------------------------------
note: I could not use the contour command with the 3D matrix.
>> contour(vq(:,1,:),vq(:,2,:),vq(:,3,:))
Error using contour (line 46)
Input arguments must have at most 2 dimensions.
---------------------------------------------------------------------
>> contour3(vq(:,1,:),vq(:,2,:),vq(:,3,:))
Error using contour3 (line 42)
Input arguments must have at most 2 dimensions.
---------------------------------------------------------------
>> contour3(vq(:,1,1),vq(:,2,1),diag(vq(:,3,1)))
Error using contour3 (line 44)
Vector X must be strictly increasing or strictly decreasing with no repeated values.
-----------------------------------------------------------
>> scatter3(vq(:,1,:),vq(:,2,:),vq(:,3,:))
Error using scatter3 (line 64)
X, Y and Z must be vectors of the same length.

回答 (1 件)

darova
darova 2020 年 6 月 11 日
try this
m = size(vq,1);
n = size(vq,3);
[x,y] = meshgrid(1:m,1:n);
cla
hold on
for i = 1:3
contour(x,y,vq(:,i,:));
end
hold off
  1 件のコメント
Bugce Gokce
Bugce Gokce 2020 年 6 月 11 日
I get this error:
Error using contour (line 46)
Input arguments must have at most 2 dimensions.

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

カテゴリ

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