Borrar filtros
Borrar filtros

plot 2 variables of different length

2 visualizaciones (últimos 30 días)
priya
priya el 4 de Jul. de 2021
Comentada: Image Analyst el 5 de Jul. de 2021
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).
  1 comentario
dpb
dpb el 4 de Jul. de 2021
Editada: dpb el 4 de Jul. de 2021
doc meshgrid
doc mesh
doc surf

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 4 de Jul. de 2021
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 comentarios
priya
priya el 5 de Jul. de 2021
How to plot minYValues on the surface plot?
Image Analyst
Image Analyst el 5 de Jul. de 2021
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?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by