How to draw a 3D graph in app designer?

3 Ansichten (letzte 30 Tage)
Tong Jin
Tong Jin am 9 Jun. 2021
Kommentiert: Tong Jin am 9 Jun. 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 Kommentar
Tong Jin
Tong Jin am 9 Jun. 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!!

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by