Xlsread create a copy of Excel spreadsheet?
2 次查看(过去 30 天)
显示 更早的评论
hi everyone. Xlsread create a copy of a spreadsheet's content into Matlab, or it is just a reading of the file? I have many information into a spreadsheet, and i don't want to do access to the file every time because it could slow the execution.
0 个评论
采纳的回答
Guillaume
2015-9-15
if you have excel installed and do not call xlsread in basic mode, xlsread starts Excel (but keep the window invisible), instruct excel to load the file, and then ask excel for a copy of the data in the range you've requested. Finally, it closes the file and quit excel.
It does this every time, so multiple calls to xlsread can be slow. According to the release notes, R2015b supposedly improves the performance of multiple code, but the documentation actually does not say anything about it, so it's unclear how it is improved. A quick reading of the code would indicate it still does the whole start/load/read/unload/quit on every call.
It would be much better to read all the content that you need at once and slice it into variables afterward.
Note that if you don't have excel or call xlsread in basic mode, then matlab attempts to parse the file directly.
0 个评论
更多回答(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!