My code is keep plotting the wrong data
Mostrar comentarios más antiguos
I have a 9 coloumns by 150 rows matrix and I have chosen three coloumns from it to form my new 3 comloumns matrix, so I chose second to be my Z (hight) and 8 and 9 to be my x and y respectively.
M = TEST(:,[8;9;2])
surfl(M)
So, now I have a 3x150 Matrix and idealy it is 3 coloumns where first is X, second is Y and third is Z. Whenever I use surf. comand it plots wrong data and I am sure when I pick a plotted point it is all wrong. I do not know what to do to fix it.
and I do not want to plot a mathematical function I already have X Y and Z, and when I separate them, the code gives me an error that Z must be a matrix not vector, while it is obviously a matrix. I do not know how to solve it.
Respuesta aceptada
Más respuestas (1)
Jonas
el 7 de Jul. de 2022
0 votos
may the scatter3() command is suffiecient to visualize your data, you interpolate (e.g. interp3) your XYZ data to generate more points and use surf() after that
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
