Borrar filtros
Borrar filtros

For loop issue using fprintf to output contour3 levels to file.

1 visualización (últimos 30 días)
Attempting to separate the contour3 output to a file (test.txt) with rows of x,y,z coords to represent contour levels.
My current issue is that I can't see how to make the For loop move to the second level, it stops after outputting the 8 entries of vertices that are in Level A. To be clear, each level is at a particular z-value.
The link above is the help file for contour3 outputs, it's a bit specific. And those are the formatting rules I'm following.

Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Oct. de 2020
I recommend that you use a utility routine from the File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/38863-extract-contour-data-from-contour-matrix-c
  4 comentarios
Adam Danz
Adam Danz el 6 de Oct. de 2020
Editada: Adam Danz el 6 de Oct. de 2020
I shared an alternative function on the file exchange that organizes the contour coordinates in a table. The Level column shows the contour level. Since there can be more than 1 contour line at the same level, the Group column is a grouping variable that identifies which contour line each coordinate belongs to.
contourTable =
n×4 table
Level Group X Y
________ _______ _______ _______
-5.8504 1 0.44266 -1.75
-5.8504 1 0.375 -1.8038
-5.8504 1 0.25 -1.8526
-5.8504 1 0.125 -1.8498
etc...

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Debugging and Analysis en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by