while using readtable comand for xlsx file, i get the table with cell value as text/cell, not in value format.
1 次查看(过去 30 天)
显示 更早的评论
I am facing MATLAB crash while using xls file, so i have to use xlsx format only.
I tried to import following excel (xlsx and xls)file by read table command. but the output of xlsx is different(Not acceptable, becase cell values are not in number form), how can I get the same output by xlsx as I got by xls?
>> Data_L1= readtable("Initialise.xls",Sheet="LAYOUT");
>> Data_L1= readtable("Initialise.xlsx",Sheet="LAYOUT");
Thanking you and looking forward to your feedback.
采纳的回答
Cris LaPierre
2023-3-29
I would use the import options to set the parameters.
opts = detectImportOptions("Initialise.xlsx","Sheet","LAYOUT");
opts = setvartype(opts,"CR","double");
opts.MissingRule = "omitrow";
Data_L1= readtable("Initialise.xlsx",opts)
Another option is to read it in as numeric array using readmatrix
Data_L1= readmatrix("Initialise.xlsx","Sheet","LAYOUT","MissingRule","omitrow","Headerlines",1)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!