Hello there,
I would like to define certain variable, say initial_position, and pass it to the MATLAB Function block as an input argument. Moreover, I want Simulink (or rather the body of MATLAB Function block) to guess that this variable is defined in the workspace, so that I pass only other arguments via input terminals.
To put this more clearly, I would like to define MATLAB Function block, which will begin as follows
function out = my_MATLAB_Function(arg1, arg2, initial_position)%% ...
end
where my MATLAB Function block will have only two input terminals for arg1 and arg2, and initial_position is only defined within workspace.
In the documentation for MATLAB Function block, under n – input argument field, we have the following message:
When you add the argument in the editor, the block adds the port correspondingly.
I am sure, however, that there is more to it, as I have access to simulink model, which does exactly what I pictured above, yet I lack the knowledge how to set it.
Best Answer