image
 

Getting Started

In MATLAB command window, enter: >> simulink and press ENTER to invoke Simulink.

A Simulink Library Browser window should appear as one shown below.

To see the content of the toolbox, click on the + sign at the beginning of each toolbox.

To start a model click on the New Document icon as shown:

A new window will appear on the screen. You will be constructing your model in this window. Also in this window the constructed model is simulated. A screenshot of a typical working (model) window that looks like one shown below:

Now you may begin to construct your model. To become familarized with the structure and the environment of Simulink, you are encouraged to explore the toolboxes and scan their contents. You may not know what they are all about but prehaps you could catch on the organization of these toolboxes according to the category. For instant, you may see Control System Toolbox to consist of the Linear Time Invariant (LTI) system library and the MATLAB functions can be found under Function and Tables of the Simulink main toolbox. A good way to learn Simulink (and MATLAB or computer programs/packages in general) is to practice and explore. Making mistakes and know how to correct the mistakes is also a way to learn. Don't afraid to make mistakes as you go along.

A simple model is used here to introduce some basic features of Simulink. Please follow the steps below to construct a simple model.

STEP 1: CREATING BLOCKS:

Open (Expand) the Simulink toolbox by clicking on the + sign infront of the Simulink entry in the Simulink Library Browser. Further expand Sources sub-library. You should see a Sine Wave entry in the list of sources as show in the screenshot below.

Mouse action: Click on the Sine Wave block to select and drag it to the model Window as shown:

Now you have established a source of your model. In similar fashion, create additional blocks in your model window.

NOTE: It is advisable that you save your model at some point early on so that if your PC crashes you don't loose so much time to reconstruct your model.

I am going to save this model under the filename: "simexample1". To save a model, go to the pulldown File menu in the model window and select Save As. A extension named ".mdl" will be automatically appended to the filename (just enter the filename). Simulink will recognize file with .mdl extension as a simulation model (similar to how MATLAB recognizes files with the extension .m as an MFile).

Continue to build your model by adding more components (or blocks) to your model window. We'll continue to add a scope from Sinks library, an Integrator block from Continuous library, and a Mux block from Signals & Systems library. Once all the blocks are dragged over to the model window, you would have a window that looks like one shown below.

You may remove a block that you don't want by clicking on the block to turn it to the select mode (with four squares at the corners) and use the DEL key or keys combination CTRL-X (control key and X key at the same time) to remove the block. For example, say that I want to change my mind and want to use repeating pattern or sequence as the source instead of sine wave. I simply select the Sine Wave block and do a CTRL-X to remove it then do a click-n-drag on the Repeating Sequence block.

STEP 2: MAKING CONNECTIONS

To establish connections between the blocks, simply move the cursor to the output port ( represented by ">" sign at the rightside of the block) of a block (the cursor will become a cross "+" as you move the cursor over the input or output port) and left-click (pressing the left mouse button) to begin a connection. With the left mouse button depressed, drag the mouse to the input port of another block (output port is represented by a ">" at the left side of the block). To branch a connection, use the right mouse button in a similar fashion. A connected system is shown in the screenshot below:

STEP 3: RUNNING SIMULATION

You now can run the simulation of the simple system above by clicking on the play button (, alternatively, you may use key sequence CTRL+T, or choose Start submenu under Simulation menu) . The signal generated by the Repeating Sequence block will be displayed on the Scope block. This signal will also be integrated by the Integrator block and to be display simulaneously on the Scope block. Double click on the Scope block to display of the scope. A typical display is shown below.

The above steps demonstrated some basic functions and structure of Simulink. It is strongly recommended that you take some time to explore the toolboxes and familiarize yourself with the parameters associated with each block. To view/edit the parameters, simply double click on the block of interest.





 
image