How to draw a 3D graph in app designer?

3 visualizaciones (últimos 30 días)
Tong Jin
Tong Jin el 9 de Jun. de 2021
Comentada: Tong Jin el 9 de Jun. de 2021
Hello, guys! Could someone please answer my question about 3D-plot. In App designer I have a table. And then I would like to draw a 3D-Plot by surf(X,Y,Z,C). X is column named X(mm), Y is column named Y(mm), Z is column Z(mm) and color is column ED+. I have already converted the datatype from table to matrix by table2array. But I got the error :'' Z must be a matrix, not a scalar or a vector''. Then I checked the Tipps of surf: ''Z must have at least two rows and two columns''. But in my table Z is a Xx1 Matrix. How can I exchange Z to fulfill this condition. Thanks a lot!
  1 comentario
Tong Jin
Tong Jin el 9 de Jun. de 2021
Hello, guys! Fortunately I have solved this question! I converted matrix Z und ED+ by 'repmat' to repeat copies of array: https://de.mathworks.com/help/matlab/ref/repmat.html
Before convert X,Y,Z are (m,1) matric
Expanding Z and ED+ to (m,m) matrix. It means, repeating the column of Z and ED+ for m times.
Finally 3D Plot worked!!!!
I hope it's helpful, if someone face the same question!!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB 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