problem with csv to .m conversion
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I am having problem reading in this file to matlab.
Data = fileread('100Cr6.csv');
Data = strrep(Data, ',', '.');
FID = fopen('kf100CR6.m', 'w');
fwrite(FID, Data, 'char');
fclose(FID);
i use the following code but it does not generate the data what i want?
i want every data in double notation (like 1231.2354) format. so that i can use these as columns or rows of matrix.
Does anyone have a solution to this?
Many thanks.
댓글 수: 0
답변 (1개)
jonas
2020년 7월 5일
try readmatrix() or readtable() instead
Data = readmatrix('100Cr6.csv','NumHeaderlines',1,'DecimalSeparator',',');
댓글 수: 4
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!