Filter löschen
Filter löschen

Xlsread create a copy of Excel spreadsheet?

2 Ansichten (letzte 30 Tage)
Daniele Morello
Daniele Morello am 15 Sep. 2015
Beantwortet: Guillaume am 15 Sep. 2015
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.

Akzeptierte Antwort

Guillaume
Guillaume am 15 Sep. 2015
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.

Weitere Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by