Making a contour map using a 3D matrix

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일

0 개 추천

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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

질문:

2020년 6월 11일

댓글:

2020년 6월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by