Xlsread create a copy of Excel spreadsheet?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Daniele Morello
el 15 de Sept. de 2015
Respondida: Guillaume
el 15 de Sept. de 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.
0 comentarios
Respuesta aceptada
Guillaume
el 15 de Sept. de 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.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!