Need help with contour plot
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Star Strider
2022-12-9
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))
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!