I'm using an initialization cell to import a lot of data:
data = Import[myFiles];
and then I use a custom function to display this data with Manipulate:
Manipulate[customFunction[data,variable],{variable,{0,1}}]
I have to keep these two commands in two seperate cells, because importing the data in customFunction
each time I manipulate variable
would take a lot of time.
The problem is, when I start my notebook, Manipulate
is evaluated automatically and sends a lot of error messages, because data
is not defined. I know it might go against what Manipulate is made for, but is there a way to prevent Manipulate from being evaluated until I import my data for the first time?
SaveDefinitions->True
? $\endgroup$Manipulate
is evaluated right away. $\endgroup$data = Import[myFiles];
once and then again only ifmyFiles
change? Is there a bad side-effect of saving a lot of information withSaveDefinitions -> True
(in terms of time for the notebook to load for example)? $\endgroup$Manipulate
will remember the last state it was in, including all controls. As to performance issues, you just have to try and see. $\endgroup$