writematrix output file that can't be read by textread
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mahmoud Elzouka
am 17 Apr. 2023
Kommentiert: Walter Roberson
am 18 Apr. 2023
I am using writematrix to write a 2D matrix to csv, and read this csv later elsewhere (e.g., Python Numpy).
The problem is that this file always errors, even when I read this file using textread.
Would you please help me?
Here is a sample code to reproduce the issue:
filename_ = 'sample_matrix.csv';
writematrix(rand(20,30), filename_);
textread(filename_) % this errors
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 17 Apr. 2023
The format specification is mandatory for textread
4 Kommentare
Walter Roberson
am 18 Apr. 2023
textread must be given at least two parameters. textread is for reading formatted data and you have to tell it the format. textread is not for reading a file as a single character vector: I already gave links to two routines for that.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Import and Export 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!