plot 2 variables of different length
1 次查看(过去 30 天)
显示 更早的评论
x = 100:400 ;
y = 600:1500 ;
Z = 3*x+2*y ;
I want to plot z (along z axis) as a function of x (along x axis) and y (along y axis).
采纳的回答
Image Analyst
2021-7-4
Try meshgrid():
x = 100:400 ;
y = 600:1500 ;
[X, Y] = meshgrid(x, y);
Z = 3 * X + 2 * Y;
surf(X, Y, Z, 'EdgeColor', 'none');
fontSize = 15;
xlabel('X', 'FontSize', fontSize);
ylabel('Y', 'FontSize', fontSize);
zlabel('Z', 'FontSize', fontSize);
title('Z = 3 * X + 2 * Y', 'FontSize', fontSize);
colormap(jet(256));
colorbar;
7 个评论
Image Analyst
2021-7-5
I show you the image on the right. Can you show me exactly what you'd expect your surface plot to look like if I did what you are asking?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!