Filter löschen
Filter löschen

Fastest way of opening a text file and converting it to a matrix?

5 Ansichten (letzte 30 Tage)
Alex am 29 Mär. 2024
Beantwortet: Walter Roberson am 29 Mär. 2024
I currently have a large amount of text files i want to convert to matrices, each text file will have the same structure. I am currently using readmatrix but just opening and reading a few takes too long. Is there a faster way?

Antworten (2)

Rik am 29 Mär. 2024
doc fscanf
If you know the format, using that knowledge always improves speed, since the more complicated tools don't need to spend time figuring out the file structure.

Walter Roberson
Walter Roberson am 29 Mär. 2024
If your file happens to be just a rectangular block of numbers, with either blank or comma between them, then the fastest approach is to load() the file.
If your file happens to be some other form, then the fastest approach depends on the details.


Mehr zu Live Scripts and Functions finden Sie in Help Center und File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by