Get MatLAB to read data instead of text
3 次查看(过去 30 天)
显示 更早的评论
I have some data in Excel that I'm trying to import into MatLAB. The imported file works fine, except MatLAB is recognizing the first colum as text instead of data. Essentially, MatLAB skips the first column of data and goes right to the second because it thinks the first column is text. This has really screwed up my code/data plots... Does anyone know how to get MatLAB to read text as data?
0 个评论
回答(1 个)
David Hill
2022-11-15
Try readtable
t=readtable('yourFile.csv');
1 个评论
Walter Roberson
2022-11-15
readmatrix instead of readable if you want to force the first column to numeric. Or else fiddle with import options.
Or possibly the situation calls for HeaderLines
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!