readmatrix behaviour is unpredictable
조회 수: 2 (최근 30일)
이전 댓글 표시
I've started using readmatrix as it is recommended instead of csvread and dlmread - I actually like that it pads with nans, but at the minute that's all I like.
In the past couple of weeks since I started using it, twice have I got weird unpredictable behaviour.
I fixed the first problem (it was skipping the first n lines for random files) by setting DelimitedTextImportOptions.
Now it is reading data into cell arrays instead of regular arrays. I've no idea why it should do that, I wrote to file using writematrix...
Anyway, how can I force readmatrix to read into an array of doubles?
댓글 수: 0
답변 (1개)
Urmila Rajpurohith
2020년 6월 30일
you can try :
M = readmatrix(filename,'OutputType','double')
Refer to the below documentation for more information on namevalue pair arguments of "readmatrix" function.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!