I have a function in which I load variables from a MAT-file and then start a Simulink model using the SIM function. The function looks as follows:
function startfunload 'mymatfile.mat'sim('mymodel');end
The model contains some constant blocks which use the loaded variables for their "Constant value" parameter. However, running startfun results in the following error:
ERROR: ??? Error using ==> startfun at 4 Error evaluating parameter 'Value' in 'mymodel/Constant': Undefined function or variable 'myvar'.
where myvar is a variable saved in my MAT-file and that I use for the constant value in a constant block.
Best Answer