How to import Data from a textfile that are in a float like format
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Patrick Benz
il 12 Feb 2021
Risposto: Walter Roberson
il 12 Feb 2021
I've got a Problem with the "importfile" function in Matlab.
I've got a txt file with coordinates from Abaqus. The problem ist the format.
As an example these are two lines from the File:
1, -20.8047047, -9., 9.
17, -41.7204437, -15.691452, -15.691452
It is: Node Number, x-coordinate, y-coordinate, z-coordinate
When I am using the "Importfile" function I get an Error which you can see in the picture.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/517512/image.jpeg)
So I know the problem is probably the format of the -9.,
I can't change the format of the output. Is there any opportunity to import the data from the file?
0 Commenti
Risposta accettata
Walter Roberson
il 12 Feb 2021
I recommend using readtable() instead of importfile()
I suspect that importfile has decided that the delimiter is space, and then textscan is choking because it is seeing a comman instead of a number.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Other Formats in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!