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 visualización (últimos 30 días)
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?

Respuesta aceptada

Star Strider
Star Strider el 10 de Jul. de 2023
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')
.

Más respuestas (0)

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by