Search code examples
matlabsimulink

Matlab Simulink generating no output


I am learning Matlab Simulink. Here is the basic simulation that I'm doing.

enter image description here

When I pressed Start Simulation I get these errors.

enter image description here

Then as suggested here I changed my settings to this.

enter image description here

But now when I am simulating, a warning sound beeps but no error message is showing in Matlab Command Window and I am not getting my output.

Where is the problem and how can I solve it??

I am using Matlab 7.10.0(R2010a).


Solution

  • You're not getting any output in the Command Prompt because you haven't specified any sinks to export the data to the Workspace and so workspace variables aren't created. You're only able to see the output in the Scope tool in Simulink but this data hasn't been exported to your workspace. In Simulink, there is a To Workspace block that you can use to pipe the sinusoidal data to the workspace. In the Sinks section of the Library Browser, choose the To Workspace block and connect the output of the Sine Wave black to this block... so:

    enter image description here

    enter image description here

    To make things compatible, make sure you choose the option to output your data as an array format instead of time series... well I find that the array option is better. Open up the To Workspace block and change the output to Array:

    enter image description here

    When you do this and run the simulation, you should see a variable called simout in your workspace that captures this data and tout that measures the time steps of each output amplitude in your sine data:

    enter image description here

    You can then plot the data by doing just plot(tout, simout);

    enter image description here

    Minor Note

    The "warning" beep happens because MATLAB is telling you that Simulink has finished the simulation. Nothing wrong is happening.