Reading strings into Matlab from excel?

[亡魂溺海] 提交于 2020-01-03 08:09:33

问题


I would like to read strings into Matlab from an excel file

ID = xlsread('data.xlsx',1, 'D2:D4')

the cells in range D2:D4 have strings in them. When I try to import the strings into Matlab all I get is an empty list? what can I do to fix this?


回答1:


If you're in Matlab 2010 you can also do something like this to avoid having extra values in your workspace.

[~, ~, raw] = xlsread('data.xlsx',1, 'D2:D4')



回答2:


I need to use this [num, txt, raw] = xlsread('data.xlsx',1, 'D2:D4')

the txt will import stings into Matlab.



来源:https://stackoverflow.com/questions/3104473/reading-strings-into-matlab-from-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!