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

1 visualizzazione (ultimi 30 giorni)
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.

Risposta accettata

Walter Roberson
Walter Roberson il 5 Ott 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 Commenti
Adam Danz
Adam Danz il 6 Ott 2020
Modificato: Adam Danz il 6 Ott 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...

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Debugging and Analysis in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by