Hello,
I'm trying to run a simulink project using the matlab command "sim()". This is a semplification of my simulink project
where, instead of 'simin' and 'simout' there are the names of the vars to import and export from the workspace.
Now I'd like to give to this system various input (step, waves, ramps etc) without using the Simulink blocks but directly from Matlab.
My question is: how can I create such mathematical functions?
I've tried this code for example:
x=0:0.1:1000simin=cox(x)sim('Simulation.slx')
but it give me the following error
Error using MatlabProject (line 47)Error due to multiple causes.Caused by: Error using MatlabProject (line 47) Error in port widths or dimensions. Output port 1 of 'Simulation/Sum4' has 10000 elements. This port does not accept the dimensions (or orientation) specified by the output signal. Error using MatlabProject (line 47) Error in port widths or dimensions. Invalid dimension has been specified for input port 1 of 'Simulation/Plant1'.
where MatlabProject is the Matlab file and Sum4 is the sum block in the previous picture.
Can you please help me?
Thanks.
Gianluca
Best Answer