I have tried a number of ways, all to little or no avail. At the moment I have a number of surfaces stored as cfit objects, which I would like to evaluate within a matlab function block in simulink. However, I can't find any way to pass these objects into the function from the workspace (it doesn't need to be from the workspace; is there any way to load an object within simulink or in the matlab function block such that the matlab function block can use the object?). I've been trying by changing the type of scope to parameter or data store memory. I have the cfit objects saved in a .mat file, and also in the workspace.
Things I have tried so far:
- Convert the cfit object into a function and pass it as a function handle (parameter into the matlab func block)
- Pass it as the object itself (parameter into the matlab func block)
- Pass the .mat file as a Data store memory object
I've been struggling with this for a few days and honestly really surprised that I haven't been able to find any solution; it seems like it should be quite easy. The only method that I have been able to use to pass the info in the cfit object into the workspace is by using an interpreted matlab function block in simulink, and passing the cfit object as a function. Would there be any way to use this interpreted matlab function block within a matlab function block? I am grasping at straws here.