Only read data once (with xlsread)
Mostrar comentarios más antiguos
Hi there,
I am using xlsread to import data from Excel. This takes quite some time, but that's ok. The real problem is that Matlab loads the data whenever I run the script. Hence, whenever I change a few variables and run the whole script, I have to wait minutes because matlab is working on re-loading the data using xlsread.
Is there any way to only load the data ONCE and not every time I run the whole script?
Any help is much appreciated. Thank you very much.
Best Christian
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 3 de Mayo de 2015
2 votos
Yes. You can make a GUI with two buttons and a few other controls to change variables (input parameters). One button will run a function that loads the data. Then the other one will get the various settings of your input parameters and run the analysis code.
Also go over the Mathworks video tutorial on using GUIDE: http://blogs.mathworks.com/videos/category/gui-or-guide/
6 comentarios
Christian
el 3 de Mayo de 2015
Image Analyst
el 3 de Mayo de 2015
Try this:
>http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F>
Or else save your variable into a mat file with save() - thi smay be quicker to get back into your other functions than launching Excel.
Image Analyst
el 3 de Mayo de 2015
By the way, that reminds me of something I heard long ago while working for the government: "There's always time to do it over, but there's never time to do it right in the first place."
Christian
el 3 de Mayo de 2015
Image Analyst
el 3 de Mayo de 2015
Glad my/our mat file suggestion (3 comments up) worked for you. Though you can only Accept one, perhaps you could also "Vote" for my answer too.
Christian
el 4 de Mayo de 2015
Categorías
Más información sobre Workspace Variables and MAT Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!