Hi,
I am currently trying to make a standalone version of my Matlab scripts in order to run it on a cluster. Unfortunately I am running into problems, when calling simFunctions (supplied by the SimBiology Toolbox).
In the Matlab terminal everything works just fine, but as soon as I compile it and do a test run through the terminal I get this error:
Warning: Variable 'Model' originally saved as a SimBiology.Model cannot be instantiated as an object and will be read in as a cell.> In TEST_Script (line 2)Undefined function or variable 'createSimFunction'.Error in TEST_Script (line 5)MATLAB:UndefinedFunction
I read http://ch.mathworks.com/products/compiler/supported/compiler_support.html that simBiology Models and simFunctions can be compiled.
Here is the code
%%Load Model
load Model;%%Generate SimFunction
mySimFunction = createSimFunction(Model, {'Parameter_1','Parameter_2','Parameter_3','Parameter_4','Parameter_5','Parameter_6'},... {'Output_1','Output_2','Output_3','Output_4','Output_5'},[], 'UseParallel',false);%%Generate Input
Input = [1,10,10,5,5,1000];%%Evaluate SimFunction
stopTime = 100000;[~,y] = mySimFunction(Input,[],[],stopTime);
Similarly, when I import only the simFunctions and omit generating them in the script I get this error:
> In TEST_Script2 (line 2)Insufficient number of outputs from right hand side of equal sign to satisfy assignment.Error in TEST_Script2 (line 9)
When using feval() for createSimFunction
%%Load Modelload Model;fun = 'createSimFunction';%%Generate SimFunctionmySimFunction = feval(fun,Model, {'Parameter_1','Parameter_2','Parameter_3','Parameter_4','Parameter_5','Parameter_6'},... {'Output_1','Output_2','Output_3','Output_4','Output_5'},[], 'UseParallel',false);%%Generate InputInput = [1,10,10,5,5,1000];%%Evaluate SimFunctionstopTime = 100000;[~,y] = mySimFunction(Input,[],[],stopTime);myResult = vertcat(y{:});
I get this error:
Undefined function 'createSimFunction' for input arguments of type 'cell'.
I am grateful for any kind of help.
Thanks, Christoph
PS I am using MATLAB2015b, MRCv90
PPS I attached files
Best Answer