writematrix output file that can't be read by textread
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Walter Roberson
2023년 4월 17일
The format specification is mandatory for textread
댓글 수: 4
Walter Roberson
2023년 4월 18일
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!