I have x of size (15*1) and y of size (14*1) and Z of size (14*1*15). I want to plot x with z at each y?
1 次查看(过去 30 天)
显示 更早的评论
I have x of size (15*1) and y of size (14*1) and Z of size (14*1*15). I want to plot x with z at each y?
0 个评论
采纳的回答
Star Strider
2023-7-10
I am not certain what you want to do.
This will plot ‘Z’ at each ‘x’ and ‘y’. It may be necessary for you to use the squeeze functiion on ‘Z’ to remove the singleton dimension first.
Try something like this —
x = (1:15).';
y = (1:14).';
Z = randn(14,15)*2 + y*x.';
figure
surf(x, y, Z)
xlabel('X')
ylabel('Y')
zlabel('Z')
.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!