i have the following type of data X (96x1 double) Y (69x1 double) Z1 (1X6624 double) and Z2 (399x1 double).
How can I plot contour (X,Y,Z1) and contour(X,Y,Z2). I am having trouble plotting these

 채택된 답변

Star Strider
Star Strider 2022년 12월 9일

1 개 추천

Because the length of ‘Z1’ is thelength of the product of the lengths of ‘X’ and ‘Y’ it may simply be necessary to reshape it to create a matrix from it —
X = 1:96;
Y = 1:69;
Z1 = randn(1,6624);
Z1m = reshape(Z1,numel(Y),[]);
figure
contour(X, Y, Z1m)
colormap(turbo)
Z2 = 1:399;
Z2factors = factor(numel(Z2))
Z2factors = 1×3
3 7 19
However, that would not work for ‘Z2’ unless it also has vectors that could describe it similarly. There is simply not enough information about it to suggest an approach to plotting it.
.

댓글 수: 2

SK
SK 2022년 12월 9일
Thankyou! worked perfectely as for z2 turns out it had the same size as z1
Star Strider
Star Strider 2022년 12월 9일
As always, my pleasure!
Thank you for clarifying.‘Z2’.

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

추가 답변 (0개)

카테고리

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

제품

릴리스

R2021b

질문:

SK
2022년 12월 9일

댓글:

2022년 12월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by