3d plot with different length of x and y

59 visualizaciones (últimos 30 días)
Lasse Murtomäki
Lasse Murtomäki el 25 de Sept. de 2020
Editada: KALYAN ACHARJYA el 25 de Sept. de 2020
My x is a vector of length 21 and y a vector of length 101. I have calculated matrix z that is 21 x 101. I want to plot it in 3D. Surf and mesh commands require the same dimensions for the vectors. Is this possible?

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 25 de Sept. de 2020
Editada: KALYAN ACHARJYA el 25 de Sept. de 2020
As per the you data sizes, following is also allowed
contour3(x,y,z');
Note: I presumed that x and y are continously increasing or decreasing.

Más respuestas (1)

KSSV
KSSV el 25 de Sept. de 2020
surf, pcolor is your function. You can plot using that.
x = 1:21 ;
y = 1:101 ;
Z = rand(21,101) ;
[X,Y] = meshgrid(x,y) ;
surf(X,Y,Z')
shading interp
colorbar

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by