How to plot a variable against two other dependent variables
显示 更早的评论
Suppose I have a variable z = f(x,y). How can I generate a 2D plot with z along the vertical axis with x along the bottom horizontal axis and y along the top horizontal axis? Or I could have two bottom axis, one for x and one for y.
1 个评论
Azzi Abdelmalek
2012-9-14
I don't think it's possible, a 2D plot require only 2 values
回答(1 个)
Sean de Wolski
2012-9-14
[xx yy] = meshgrid(x,y);
Z = f(xx,yy);
mesh(xx,yy,Z)
or
surf(xx,yy,Z);
类别
在 帮助中心 和 File Exchange 中查找有关 Line Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!