← Previous lessonFree lesson 3 of 3 · lesson 3 of 12

Unlock all 12 lessons of Introduction to Model-Based Development using MATLAB and SimulinkFull course ₹40,000 · paid

Price & syllabus
Free lesson · 91 min · no payment

Simulink Basics: Blocks, Signals and the Toolbar

A free lesson from Skill-Lync's Introduction to Model-Based Development using MATLAB and Simulink course, on Grow by Skill-Lync · Last updated 16 Nov 2026 · Session: “3.0 - Introduction to Simulink & Simulink Toolbars”

What will you learn in this free Introduction to Model-Based Development using MATLAB and Simulink lesson?

This lesson explains that a Simulink model is made of blocks, signals and annotations, then walks through the toolbar, including model settings, the run button with stop time, and build model for code generation. In the tool it covers signal labels, port data types, and a logic example built from relational and logical operator blocks.

  • Blocks, signals and annotations in a Simulink model
  • Labelling signals and showing port data types
  • Run and build options in the Simulink toolbar
  • Logic with OR, AND and equal-to blocks

What comes after lesson 3?

Later in Skill-Lync's Introduction to Model-Based Development using MATLAB and Simulink course (paid): lesson 4, Ports & Subsystems; Atomic Subsystems; lesson 5, Mathematical Model Representation & System Models Creation in Simulink; lesson 6, Overview of Automotive Industry. The full course has 12 lessons (28 h 4 min of video); see the course overview or its price and syllabus.

Lesson transcript

Machine transcript of the lesson audio (lightly cleaned). Technical terms may contain errors; the video is the reference.

Part 1

Hello, welcome to today's lecture on Introduction to Simulink and Overview of Simulink Toolbars. So in this lecture, we will be seeing what Simulink is about and about the basic functions and operations that are associated with the Simulink toolbar. Now let's quickly go to the topic. So Simulink is a visual programming interface, which is designed to make modeling system. It offers a way to solve equations numerically using a graphical interface rather than by programmically doing it. So the models contains blocks, signals, and annotations in the background.

If you can see the snapshot here, this is how typically the logic of any problem that you would try to develop in Simulink looks like. So the three major components of this is your block name, and there is the blocks, signals, and the annotations here. So here the blocks are the mathematical functions. They can have varying number of inputs and outputs. So this one, what I have placed the mouse over, this is a block. This constant, whatever name that is here, is a block. Add is a block.

Gain is a block. Integrator is a block. So all these are blocks, which has unique and different mathematical functions. And depending on your requirement and logic, you can have any number of blocks that you can place and you can work with your model. Signals are the lines which are connecting the blocks, which basically helps us to transfer the data between them. Okay. So here between this import voltage and this addition block, you are connecting a line, which means that whatever data that is available at the input voltage, which when called upon by this addition block will be transferred from the input to the addition block, which results in a data flow and signal flow here.

As it is said, signals are the lines connecting the blocks and it transfers the data between them. Signals can be of different data types like the scalar and the matrices. And you can also label the signals here. Annotations annotations annotations annotations of the text or images can be added to the model. And while not used in the calculation, they can make it easier for others to understand the model design. So usually annotations are the text, which gives a brief description of what the particular block or particular model is about.

Say here we have added an annotation at the end, which says that rotor speed is equal to theta. Here the output name is rotor speed. And we have mentioned an annotation as rotor speed is equal to theta, which means that, okay, this is some sort of a message, which is a relevant message and which gives information about this output and what basic calculation it does here. This can vary according, I mean, like depending on the requirement. Again, you can add these annotations for every block that you add, or you can add a complete annotation.

Okay. This is the logic of so and so operation. This is the logic of a DC motor. This is the logic of a closed loop system, open loop system, et cetera, et cetera. We can mention them like that here. So this is the basic introduction and overview of Simulink here. Let's move on to the next slide about the Simulink toolbar. Okay. So before going in depth to the Simulink toolbar, we can just have a basic introduction on the few properties here. And then from then on, we will open the tool and see what these operations are all about.

So this is a Simulink toolbar, which appears at the top of the Simulink model. And these are some of the important functions and properties that are present to the Simulink toolbar. So let's just quickly see a few of them. Here, something in the shape of a gear pattern. So gear tooth is there here. So this is the model settings toolbar option. So when you're clicking on this, any setting that is related to the solver equations or the code generation or the system properties, et cetera, et cetera, can be configured and set using the model configuration parameters toolbar.

The next one is the run model. Here, you can see a green color play button. So which means that it denotes for that the model is ready and can be simulated. It primarily denotes it. There are different modes of simulation, as you can see here. Normal, sometimes it can be called external, where some other signal source will try to trigger and will help to run the model. And the text box is present here with time, which essentially tells how many seconds you want to run the simulation.

If you want to try to run it continuously instead of the numerical time, you can mention even as infinite and we can run it. The next one here is about the build model. Say you have developed a complex hardware model has been developed. You need to see if you can build this model. Build the model as in here stands for generating a code out of it. So that generated code can be flashed into an electronic control unit and we can use it for further levels of testing.

So basically, for code generation purpose, we go ahead and we check with this build model option. So these are some of the basic functionalities of the Simulink toolbar. Now we can quickly move on to the tool to have a direct demo of the same, right? OK, so you can go to new and Simulink model and directly a Simulink blank Simulink model opens with the name as untitled. You can save it as per your requirement. A control S. It helps you to save it with any specific name that you want here.

So the first option that you can see here is this create a model. So clicking on the drop down arrow here helps you to create a blank model or a chart or a library or a project as per your requirement. Likewise, you can open here. You can open and see what are the different models that is available in your set path or the recent set of models that you have opened. You can check them here. Clicking on this option helps you to save. Clicking on this option helps you to open the model configuration parameters, which governs the basic operation of a Simulink model and what kind of expected results that you would like to get from it.

So the model configuration parameters here has n number of properties or configurations which can be changed here. So this is about the solver. And when clicking on the solver, it gives you, asks you about your start time and the end time of your simulation and what type of simulation that you would like to have, which is it's a variable time step or a fixed time step and what type of solver you would like to select automatic, discrete or any other specific solver mode that you would want.

And other details of your solver here, the step size, the local settings, et cetera, et cetera, they can be known from this. The next set of option is about the data input and the output. If you wish to save your data into your workspace or your file, if you wish to read the values from your workspace, you can play with these datas. The next one is about the math and data types. When we are using any mathematical blocks or mathematical operators in our model, how you want the simulation behavior in that case, that we can choose here.

So simulation behavior of denormal numbers, you can choose. And about the data types, what should be your underspecified data type? Usually by default, it is double. You can also change it to any other thing. So use a division for a fixed point net slope computation. It has been turned off. So settings like this, most of these settings, we go ahead and to choose them as per our project requirement. When we are going into the level of model based design, usually for code generation purposes, when we are trying to develop model, we need to closely stick to these properties.

And based on that, we would have to do it. Otherwise, when you are trying to do a normal simulation and analyze your results and see, I think one can choose any one of it. There is not specific thing of choosing these properties, etc, etc. So again, you can click on the sample time. You can click on diagnostics and see if there is any algebraic loop. Should you throw an error or a warning? If you give the option as error, an error message pops up in the case of algebraic loop.

Otherwise, it is a warning. You can give none means, no issues. Even if there is an algebraic loop, it does not throw any error or warning. It continues with the simulation process. No, any warning information that is given here, which when occurred in the model, will either come as a pop-up or will be displayed in the command window. So this is something like these are like with respect to the other parameters, state name, clash, automatic solver, parameter selection. Most of these would have these three options and we can choose any one of them.

So this goes for sample time, data validity, about the resolution, signal, saturate on integer overflow, under-specified data type correction, etc, etc. Type conversion, connectivity, compatibility, model reference. Using the Stateflow parameters, hardware implementation model, referencing and a simulation target. If this MATLAB that currently we are looking at does not have any toolboxes with respect to the code generation part, so if there is a code generation related option with this model, we could have seen this code generation tab here, which lists out the appropriate properties one needs to set for code generation.

And that's why if you can see here in this screenshot here, you have this build model option and here this build model option is not present. So this is all about the configuration parameters. You can just click on this and select or you can choose control E to directly go to it. The next one is the model explorer option. So clicking on the model explorer option gives you a complete or a pan view of your model and it also gives you an access to your base workspace.

Say, for example, you're having an init file, initialization file, which when you run it, loads all your working parameters into your base workspace. Likewise, you have a complete model when you're trying to open those models and when you're trying to view your base workspace through this, it gives you what are the signals that is available in your base workspace as well as in your model. It lists it out and it shows it here. Our base workspace currently has some of the older data from the previous operation, which I have not cleared it yet.

So if you can click and if you can see, it shows the data properties here. So you have to click on top of your base workspace and then click on top of it. It tells that for the variable H, the value is 30. Likewise, if you wish to change the values, you can try to change them here and you can save them directly in your base workspace. The same goes for others, that is, it also clearly lists out its data type, a dimension and the complexity of the signal.

As said already, the data type of the underspecified values, which is already defined into my workspace, cannot be changed. And by default, it will only be double. If you wish to change them, you can say int a is equal to 20 or int 8 a is equal to 20, which means then the value a will be defined to uint 8 or int 8 data type, etc. Something like that is possible. The same goes for all. So this is about accessing the base workspace. Currently, the model is empty.

It does not have any parameters. So simply what I'm going to do is like I'm trying to add one input and trying to add a subsystem and I'm trying to add an output. OK, so let's quickly connect these lines so you can clearly see here. Once we have added them in the model explorer about the in and about the out, it has come here. So you just click on top of this. The name of it is in one. If you can double click on this and you can change the name.

Likewise, it shows the property as in port one. It shows what is the output data type, the minimum value, maximum value, log scale, integer, etc., etc. Likewise, for the output also, it is the same. The port numbers. Once you click on this, you can see the signal name. If you wish, you can explicitly specify here. Then you can move to signal attributes and you can play with them. So any number of blocks that you keep adding into your model, it all comes as a display here.

So this is about your model explorer. So you can close your model explorer. In this case, you can access your model explorer using control H option or in this drop down menu. All right. So this is about your play button. You put in some specific logic and you click on the play button. It gives or it displays the specific or required output. About the usage of play button, we saw it in one of the previous lectures. So we are not going to go specifically deep and see what this is about.

And the next option that we have here is the simulation data inspector. Once, if you have done a simulation at the model level and all the signals that is associated with your model is all passed out, it's all activated and all the signals starts exchange of the values in it. You can go to the simulink data inspector to actually inspect your signals, analyze your signals and list out what are your total set of signals that is available in your model. And you can plot and you can compare the graphs in it.

You can import, you can export your data and you can play with it in a very, very interactive manner. So that is the purpose of your simulink data inspector here. So this is how simulink data inspector looks like. Since there are no signals here and we have not run any simulation, it is not listing out the signal names. So, but over the period of time in the other future lectures, when we are trying to run a model and see, we will enable the simulink data inspector option.

We will simulate and we will observe results in the model. So this is the simulation time here. By default, it is set as 10 seconds. You can also set it as 20. You can also set it as 25 and we can keep it. So these are different modes of operation, normal, accelerator, rapid accelerator. By default, normal is there. And for most of our computer related problem solving and simulation purposes, I think it is enough to go with a normal simulation mode. And the last option is about the model advisor.

Model advisor is like MATLAB has some set of golden rules in model development. Okay, if I'm using an input, only certain properties of input I need to make use of. If I'm using an output, I need to make use of certain properties. I should only play with my blocks in a specific manner. I should not come out of it and I should not play with it. So all these will be known with the help of a model advisor. We have a dedicated lecture for model advisor completely and how to play with model advisor.

So we are not going to go deep into model advisor. We are just going to say that this is the model advisor option. This is how model advisor window looks like. So any model that you're trying to develop for large scale simulation and validation purpose. And when you're trying to take that model in future for model in loop or software in loop testing or anything, or even for the case of code generation, a model advisor report is must usually. So this is about the model advisor option here.

So there are a few other informations like the property inspector. So this property inspector, you can usually dock them and you can place them in your model. And for every block or every subsystem or every signal name, signal line that you have it with your model, you can affect the signal properties here by directly going to the property inspector, which usually comes at this pop up here. And we can play with them and we can make use of them. Likewise, this model browser option is there.

Model browser usually gives the hierarchical view and representation of the different blocks. In a nutshell, it shows. See, if you're going with a completely larger model, you do not know how many blocks that you are going to have. So in that case, this gives you a fair bit of idea of the hierarchical view of the total number of blocks that you are using. So here we have added multiple nested subsystems into the top level subsystem. So here we have a top level subsystem. We have nested it with multiple subsystems.

So by going deep into them, you can clearly see it at the hierarchical level how it is. So every time you go deep into each of these subsystems, that particular subsystem is highlighted and it is shown. And you can move to the top level of it by this. So once you're going one level up here, you can see it gets highlighted to the top level. So this is the basic usage of your model browser and different simuling properties is all present here. And if you can go to each of these tabs, more or less they are the same.

The model update or the model configuration or run, this is all we have already seen or we have covered about the model advisor report. We will be discussing in brief about the code analysis, code coverage report and other tools and other hardwares we will be seeing in brief in the future. So now let's quickly move back into the slides. OK, so about the working with blocks and others we will quickly see. So the model settings and other things we can see about it. So and one important block that we have not touched upon in brief is this block, which is the library browser.

So library browser is basically the crux. It is the repository of all the model libraries that one has with him. So we can just quickly click on this simulink library browser. So clicking on the simulink library browser shows all the list of toolboxes that is available with the current version of MATLAB that you are. And click on these arrows and it shows what are the common toolboxes that is available and also the basic MATLAB specific commonly used library blocks that is available with it. So the commonly used blocks has usually the list of very frequently used as per the application.

Then it is about the continuous dashboards, discontinuous, discrete, logical operations, lookup tables, math operations, model verification and ports and subsystems, signal routing, signal attributes, strings, sources and something like this. Usually this strings command is not available with the older versions of MATLAB. If you can go to 2015, 2016 or 2017 MATLAB and see usually these strings is not included. Here in 2019 you have large number of these blocks in usage. Apart from that if you can go to dashboard and see not a lot of these features are available.

Usually dashboard scope is not available or any other quarter gauge, etc. is not available with older versions of MATLAB like 2015 A or 2015 B, etc. Here you have a lot of basic functions to play with. So about each of these blocks and their capabilities and what they are basically used for, at least the majority of the blocks, what they are used for. We will be seeing it in the future lectures, but a quick introduction I can give about the blocks to how to add them into your model.

Now, if you wish to add these libraries into your model, say we were using some of the ports and other things in the blocks. So if you wish to add them into your model, what you can do is you can go to sources. Say you wanted to add one input, you can click on this and then you can drag and you can drop it here. Okay. If you want to explicitly change the port number, it throws a pop-up here and you can directly type and you can change the port number here.

If you wish to rename the port as 2, I have given it as 2, so automatically it changes. Now, if you wish to change the name of your signal, you can directly type on this. And you can give the name something like ABC. All right. And then you can double click on the block. It shows about the port number. Again, if you want to change the port number, you can change it. And you can again double click on this. You can go. And these are the basic object parameters that is associated with this block here.

So the minimum, maximum, the data type and the unit, the port dimension, et cetera, et cetera. To know more about these different data types and how they affect and what parameters or properties they affect, we will discuss about them more when we are trying to look at these specific library functions. So now let's simply go and see what these are basically. Also, when you can, instead of double clicking this, you can also go to the properties and you can change stuff. Like if you wish to add any annotation block or if you wish to add any block type information, et cetera, et cetera.

So these things you can do if you wish to add any callback to it. Also, you can define them all here. So you can either double click and open the block parameters or you can right click and open the block properties and you can play with this. You would have clearly seen in MATLAB that previously it was small in size. Now it has come up and come down. Yes, we are trying to zoom in and zoom them out. So using the keyboard. So how you do is like if you want this particular icon to fit your screen, just keep your mouse on this white background and hit space bar.

It appears across the best possible fit and size. So this is one zooming in and zooming out can be done using the mouse scroll. Scroll your mouse upwards and downwards. It usually zooms out and zooms in here, et cetera. So this is one if you're trying to add more port into your system here, the fitment and the zoom level changes accordingly. So this is it. When you are trying to select and create one more signal or one more input, there are different and multiple options. So you can go back to this Simulink library and you can take it.

Otherwise, you know what type of block this is. This is an input. So what we can do is just click on this white space and directly start typing in port so that it automatically adds an input. And again, the similar drill of port number and other properties you can follow here. Otherwise, if you wish to quickly keep creating more and more, what you do is you click on the specific block, right click, drag and you paste it. So like this, you can create multiple inputs and multiple blocks.

If you wish to group them all together, you can select them all like this together and a pop-up comes, you can group them into a specific area and you can keep. And whenever you're dragging them, all of them gets selected together and they can be dragged. So this is how we usually play with the basic operations at the Simulink level. So this is what we had seen here. So next, we will move to about the positioning of the blocks. All right. We all saw that you can click on the blocks and you can drag them here and there.

You can connect the signals between two blocks. You can control it and you can drag it or you can right click it and you can drag it. You can rotate them all, et cetera, et cetera. So about the basic libraries list, you can see here, it's the sources, sinks, math operations, ports and subsystems, user-defined functions, lookup tables, signal routing, continuous discrete and bit operations, types of blocks. Those are like what their purpose basically is. Sources provides input, sinks provide the output, math operations, does any mathematical manipulation, sports and subsystems.

Subsystems usually help you to break down a bigger model into a simpler model of different subunits for easier understanding and analysis and calculations. User-defined functions helps you to create and implement custom functions, lookup tables. It helps you to define and create functions as or from discrete set of data as signal routing. It organizes the signals from blocks, which is mux, bus creators, et cetera, continuous, plays with the systems with continuous states, a discrete place, systems with discrete states, and then logical and bit operations for basically Boolean related operations.

So these are the basic functions and blocks that we are going to see. So each lecture, we'll be seeing about certain set of blocks. In the next upcoming lectures, we'll dedicate them for sources and sinks together, and we'll see properties about each of these parameters here. I mean, about this, if there are multiple source options. So we'll choose a constant block and see how to play with it, what are the different object parameters that is associated with it, et cetera, et cetera. Likewise, we will be moving to the different blocks, and we will check them.

So with this, we come to the end of today's episode, and thank you.

Part 2

Hello. In today's tutorial on MATLAB Simulink, we will be looking at the block setting parameters, a little more about the model annotation and the Simulink solvers. So the block settings is that in the previous lecture, I just gave an overview about the block parameters and the block properties and how do we go and access them, etc., etc. Now we will have a detailed representation of this, of what they are here. So the block parameters is like when you double click on that specific Simulink block, it opens the block parameters where you can change the settings, which is very specific to that block here.

So in this example, which is shown here, this is for a saturation block, we can edit both the lower limit and the upper limit values as per our requirement here. This can be done when you double click on that block and it pops out of the block parameters tab. The next one is that the block properties accessing it. You have to right click and select the properties options here to go and fetch the block properties tab. The block properties tab looks like the one that is shown here.

Say you're using an integrator block. You can right click on an integrator block and you have to choose the properties tab to actually access this. You can change whatever information that you want to be displayed in this block annotation tab here, basically. So if you want to have any specific set of properties to appear, that can be done. So to quickly see this, we can move to MATLAB and I'm choosing a Simulink model, a blank Simulink model. And yes, so I will choose a saturation block.

And when we are double clicking on a saturation block, it asks for upper limit and lower limit as the name suggests here. So this is the block parameters tab. You have to double click not only on saturation. If you're using an addition block or a logical operator, math operator related blocks, the same it is. So here the property pertaining to the saturation block is upper limit and lower limit, which we change here. And the signal attributes can all be changed here. So the output minimum, output maximum and output data type is mentioned here.

And the integer rounding mode is some of the property or the values that we can change. So this all can be changed or manipulated as per the project requirement here. All right. So you can simply change this as 1.0 and 1.0. You can close, apply and close. It changes. Minimum, maximum can also be given some specific value. If you can click on this double headed arrows option, it opens up the data type assistant options. So the default one is same as input. Here you can change it to anything.

But from here, you can also manipulate these options here. If you're giving something as, say, example like Uint8, you can change the mode. If you want to have it in inherit mode or if you want to have it in a built-in mode, if you want to have it as a fixed point mode, or if you want to have it in some specific expression, you can choose them. Here again, Uint8, Uint16, you can play with it. And data type, override, inherit, or off, you can choose. And you can enable this option.

This is all as per the project requirement that you play with it. Likewise, you can also access the block properties. So what I am doing is, like, I am going to add one integrator block here. And for that given integrator block, I am going to display its initial condition and other properties that is here. So how we are going to do it? We'll go to the properties tab here. And once on going to the properties tab, let's go to the block annotation tab. And in the block annotation tab, let's click on the block type.

So you click on this, you get it. And now what I am doing is, say, for example, X0 is equal to, okay, so something like this I am able to give. And it displays whatever is the initial condition value. It displays the same here. So whatever block annotation property that we set, the same annotation value gets displayed here. Here, in this case, we are displaying it as the initial condition value. That value is assigned as X0. X0 is equal to 0. This value comes here. So you can also give it something like this.

And all right. So this is how the block annotation and others usually come. If you're giving the initial condition value as 5, at the bottom, if you can see, the initial condition value here automatically changes. If you wish to add any other properties of your system here, you can go to the properties tab. And then you can quickly add those properties here. If you wish to add the name, if you wish to add any other handle, or if you wish to add any other parameters or a block description, line handle, et cetera, et cetera, all these tags and block properties can be added into this option.

You have to click it. You have to select them and you have to click them. And then you can configure them. So this is about the block parameters and block settings. And then we'll go back to the presentation slide. And now we will have a look on the Simulink models and the MATLAB variables. Okay. The Simulink blocks contains MATLAB variables. These variables needs to be defined in my workspace before you run it in a model. Otherwise, an error will throw like an undefined variable in the workspace.

So it is a good practice to design a script usually that tells that which contains all the parameters in the model. And that script has to be preloaded when you open the model or it has to be run before a model to load all the corresponding values into my workspace. So now example for that, we can do a quick simulation on this initial values or variables. I am going to have a couple of constant blocks. Okay. I am defining a value A. I am defining a value D.

Okay. I am also having an addition block. Okay. And then I am having a display block here. Okay. This is a very, very basic and simple operation that we are going to see in first place. And it is not a complex one. So initially for this constant block, it was one. Right. You can see this. You are doing something as one plus one addition. Output two comes. Now, instead of hard coding a constant value here, what if we try to assign them to a variable? Right.

And we will see how the variables and other parameters here are dealt with and here are played with. So I am just clearing my workspace to just ensure that there are no variables that is present here. I am assigning this constant block to a variable name A and a second constant block to variable name B. Now, if you can quickly see here, this block has a red color around it. This is an indication that it is using unrecognized functions or variables. This feature is usually available with higher or very, very recent versions of MATLAB.

If we are going with a little older versions of MATLAB, we do not have this feature that is available with us, number one. And this here, it tells us that, OK, there is an undefined function or variable. So what we can quickly do is that we can go to the workspace and we can define A is equal to five and B is equal to six, for example. Now, again, click on it. Now, we have quickly refreshed the model here and seen. Now, this red color box that was surrounding this constant blocks is actually removed, which means that A and B is already defined in my workspace and I'm going to call it while running it.

Now, the values of A and B is called for A is equal to five, B is equal to six, C is equal to A plus B, which is displayed as 11. So this is what we were talking about defining the MATLAB variables. There are two ways to do it. You can hard code the values, but the most common programming practice is not to hard code the values here, but to manually enter to give a valid or a legible variable name, assign a variable name to it.

And that corresponding variable needs to be assigned in my workspace. So this is a very, very small and a simpler problem. So in this case, we need not assign our variables. You can probably practice and see for large number of problems on how you are going to assign it to your variables, etc., etc. Now, if you can go and click on your model explorer option, you can clearly see in your workspace about your variables A, B, the data type, and what data type is there for.

Your out variable here. Also, when you click on the model, you can see the different properties that is associated with the model. There is a constant, there is a constant one block, add block and a display block. If you wish to change the names of these blocks, you can change it as A. You can change the names of this. You go back to the model, the names are displayed and the names are changed. The block type is constant. If you wish to change the data type of it, you can drop down and you can choose a block type.

Choose your specific data type in this and your minimum, maximum values, something directly here you can play with. You can play it as 0 and this you can give it as 10. Okay. So again, 0 and 10 you can give it. And this is how we usually define these blocks. The same goes for addition blocks. The block parameters usually appear here. Instead of double clicking it, you can make the changes here. You can change it from rectangular to round. If you want to have a subtraction operation, you can put it as plus, plus, minus.

If you wish to have an extra addition, you can put it as plus, plus, plus, plus, which means that it will add a third port over there. So operations like this is very much possible in this case. And when you are trying to move out of it, it usually throws a pop up, whether that you have some changes, but you have not made, you have not saved those changes, whether you wish to save them or not. That is up to the individual. Whether you wish to save it, you can save it. Otherwise, you can ignore it. In this case, I'm just ignoring the same. And I am closing my model explorer tab and just coming back to this workspace.

So this is about the block settings and about defining the variable names, et cetera, et cetera. So the next, what we are going to see at the model level is about the model annotations. OK, so you can double click anywhere on the background of your model and you can type a comment. So pressing enter will select a create annotation option from the quick menu. You can also use the annotations tool, which is present as a palette here, and then you can type it. You can use texts, images, you can use Greek letters and everything.

So let's quickly have a look of how these annotations are going to be used in this model. So this is an addition of two numbers. What you can do is when you are double clicking on this white background, it asks for an option of create annotation. If you're typing normally something, it opens up about the Simulink library browser. But you can click on create annotation. The annotation tab appears in this way. You can type it like addition of two numbers. You can select them, you can change your data size, you can actually select them bold, italics, you can change the font color, and you can just play with n number of these properties.

You can draw borders, you can give background colors to these annotations, et cetera, et cetera. They all can be done. This is all possible with these annotations. Likewise, there is an option of you can go to this. This is what we were talking about. You can go to this, click on this, and then you can type annotations. And how many times you want to add that many times you can give, you can add these annotations in this model, basically. So the next option that we will be seeing is about the labeling of the signals.

So here we have defined some variables. There are cases where you have to name, instead of naming the blocks, you have to name the signals, whatever that comes as an output. We'll just see a quick example of it. So for that, what I am taking is I'm taking a sine wave source, and I am taking an integrator block. I am taking another saturation block, and I am taking a scope, okay? Okay. So this is something like this we have here. So these are the lines that is connected in between.

If you wish to name these lines as well, you can directly double-click on these lines, and you can give it as, say, x underscore dot. This is x, and this you can name it as x underscore limited. So now about the properties of these lines, and you just click on these lines and go to the property inspector, and you dock them. The signal name is there. Here again, you can edit the signal name. The storage class and the customizing it and all that can be done at this level.

So more about these signal names and playing with the signal names, we will be seeing it in future cases. But generally, the good programming practice that one has to say is to label the signal. So these are simpler applications when you're going for a little bit of high level of applications of code generation and others, or when you're playing with ports. In this case, your A and B carry information about the values that your signal has. Not all cases would have, I mean, a variable can be used.

Sometimes the signals would have information regarding them, and those values need to be used in the model. So in those cases, especially, we will be using them all. I mean, we will be using them here. So that is it about model annotations of labeling text and image annotation and the signal labeling part. So the next one we will be going for is the display menu. So what this display menu is all about and others. So the display menu allows you to easily toggle on and off the information about your signal.

So you can go to display signals and ports options and choose the port data types. It shows you each type of signal. It shows the sample time-related information, and also it chooses the wide non-scalar input. It gives whether there is any mismatch with the combination of signals that is being used. All those informations it gives. So you can quickly go back to the Simulink model. This is the display option that we were talking about. And you can go to display signals and ports options here. And in signals and ports options, you can click on the port data types.

If there are any inputs that is being used in your model, those inputs would have the data type of those inputs would be displayed here. Okay. So here you have the ports, the data types. We have defined them as int 8, int 8. Here the data type we have displayed as inherit. So the output data type is inherit. So since both these are integer 8 signal, the output of this is also an integer 8, obviously. And that value is displayed. Here in this case, if you can see, the sine wave and the integrator and the saturation blocks all have fixed default data types.

We are not playing with them or we are not manipulating them. So it is chosen as double. The same double data type is information is displayed here. Okay. So this is about the signals and port options that is there. There is an option for displaying of your error and warnings. Say you're trying to simulate your model. If there is any error in the model, where and how it would be notified is via a pop-up message. Or if there is any warning in the model, that would also be notified first via a pop-up message.

So displaying of that message option, when you tick on this, it comes. And then you can remove highlighting, display highlighting, and you can hide automatic names. So it hides all the blocks names. If you click on hide automatic names, it hides all the blocks names. So otherwise, you can just remove it here. And for view option, again, the model browser, show model browser, property inspector, it's already docked. And we have placed them at the left corner here. The model data, editor, view marks. So these are one of the many options that one would use.

Again, going here, we can access the library browser, model explorer, et cetera, et cetera. You can go to the edit option, does the basic editing work here. And the diagram option, which would basically help us to format with styles, colors, to rotate the blocks, flip the blocks clockwise, counterclockwise. You can click on any one block, and then you go to diagram, and you can go to rotate and flip. You can do them all here. You can mask for the given blocks. You can mask them. And for the signals and ports, you can create.

You can go to, you can define the properties of the signals here. And the block property changes, block parameter related changes, like how you either double click them or you right click and you choose the properties, double click on the block parameters. Same can be done by selecting here and going to the diagram again. Again, simulation stands for this. We have already seen in the previous lectures. So more and more while using it, we will have an awareness of what this is. Again, as far as the formatting option is concerned, some people as per the requirement and others would like to format them.

So here we saw about formatting of the block through the different colors, what foreground color and what background color we needed, etc., etc. Likewise, you can even change the colors for each of these blocks. Say you right click and you go to format and you can choose background color. In this case, I'm choosing it as yellow. Background color changes. So, and this again constant block, I'm going and I'm clicking on shadow. You can clearly see that the black border appears here, which means that there is a shadow for this click block here.

And you can again go and remove the shadow as well. And the next option is again, I'm choosing the background color is gray here. Now, I wish to add a foreground color to it. That also can be done. I'm adding a foreground color. The foreground color does not give color for the block inside, but it gives the color outside. So you can also add a foreground color to your model. This is very much possible. So all these cannot be done simply then and there. It must all be done only when there is any specific project related requirements for you.

So we go about doing all these. You can add, you can hide the names, display the names, add foreground colors, add background colors. You can have the shadows. You can remove the shadows, etc., etc. All these can be said and done. So now let's quickly move to the presentation slides. So about the display and about the block annotations we saw. The next one is about the solvers. So most of the time for common simulation settings at the start, we can use the default settings in the solvers to run our model.

However, in some time, we will find out that if you want the model to execute its steps at a specific rate, we have to configure these solvers. So what these solvers settings are and how to configure them, we will look at it now so that we will quickly go to the model. It's in the model simulation and model configuration parameters here. So let's quickly go back to the MATLAB and let's choose the model configuration parameters. And in the model configuration parameters, there is this option called as start time, stop time, which is the simulation settings time.

About this we have already seen. In the previous lectures, we can choose either fixed step or the variable step solver. And in this, as per the requirement, you can choose any one of it. You can choose ODE 45, 23 or whatever set of values that you have in this. And you can conclude to run the simulation here. So this is about the solvers in Simulink. So the two types of these solvers, fixed step, variable step. So about this, we give a read through in the presentation slides quickly.

So a variable step solver is a default one. This will automatically adjust the step size as the model is being run. If you are using variable steps, generally keep the default solver setting. That is ODE 45. Set the maximum time step to a small fixed value to improve the smoothness of the results. This is for a variable step solver. For a fixed step solver, will be necessary for models with discrete components. If it also has no continuous components, then you can change the solver to discrete and you can run it.

So this is about the solvers. And with this, we have come to the end of today's lecture on the block settings, model annotations and solvers. Thank you.

Part 3

Hello. In today's tutorial on MATLAB Simulink, we will learn about the sources and the SYNC libraries. In the previous lectures, we had a chance to look and use most of the libraries and its properties, especially the sources and the SYNC libraries. Here, we will have an idea about the few others that are possibly used in different applications and also about how to play with them, what are the key block parameters and object parameters and properties that is associated with them, etc., etc. We will get to see them here. Okay. So now let's quickly move across the slides.

Sources, it provides different types of signals for your model. The simplest and the most common source is a constant block. The block that outputs a constant value, basically. There are others as well, like signal builder, sine wave, step size, etc., etc. So let's move into MATLAB toolbox and go to the library browser. Inside the library browser, there is the sources. So there are these many MATLAB sources that is available, which as per your requirement, you can use the most common one is the constant block. Apart from the constant block, we also use signal builder and step size and pulse generator, import, counter free running, etc., etc.

They all can be used as per our project requirement. So that's what we do it here. And apart from that, now let's quickly move back to the presentation slides. Okay. So for more periodic functions, we go for sine wave and step size, as we had seen. For sine wave, key block parameters that one needs to know is the amplitude and frequency. And the next one is for step size. It is the step time, initial value, and the final value. Likewise, for pulse generator, the key block parameters are amplitude, period, pulse width, and phase delay.

And for signal generators, it is waveform that is basically sine, square, sawtooth, or random, etc. Assume that we want to use a sine wave block to look at the frequency response of the system repeatedly by editing the block parameters to change the frequency. The frequency of this is a very, very tedious one. So the alternate for that is to use an external time input to it. So we can use an external clock and a slider gain value. And by manipulating the gain value here, this sine wave and the frequency response of the system does change.

So this is one way to make effective use of the blocks. So this is how even a clock block can be used into the system, which gives us an external time input to your block or to your model. So this is an overview of the sources block. I'll quickly read through about what the sources and what sync blocks does. And then we can go into the model and we can see them. OK, so the sync blocks, the blocks in this libraries are mostly used for viewing the data from the model.

The scope plots or any display of the output values, etc. is basically seen with this. So this is an example of the scope block. When you double click on the scope block, these options appear, which is the zoom in, zoom out. And then configuring your scope parameters menu here, or you can zoom in along the x-axis and y-axis, which does your scaling related operation. So all this is very much possible with the sync blocks. And apart from that, you can log your outputs into your workspace directly.

That is without using a display block or a scope block. We can use two workspace block, whatever variables that is being read into this two workspace block. It writes them with the same data type and the other information. It just takes those information and it writes them directly into my workspace. So this is what it does. So these are all self-explanatory about the display, the x-y graph and stop simulation. Some of the most commonly used blocks are probably the display, the scope and the two workspace blocks.

So now, since we have seen about all of this quickly, we'll move to these blocks quickly. Let's move to the model. So we already have this model that is available and open with us. So to see what they both do together, I'm just quickly selecting a constant block and then I am also quickly selecting a display block. OK, so let's connect them. You change the value to 10 and you try to simulate it. The 10 output is displayed here again, as we have already seen. So these are some of the different system parameters.

You can define minimum, maximum values inside this. The data type, the default one, whenever you give as inherit from constant value or anything, it takes the default data type value here. Otherwise, you can specify any user defined data type. If it's a U and 8, your values should be between 0 and 255. So let's now quickly see what happens when you are giving a value more than 0 to 255. First, we'll give a value that is lesser than 0 to 255. We simulate the signal type changes to U and 8.

Now let's give a value 300 and let's see what happens here. This is where the error message pops up. It will give us an information that parameter overflow occurred for the value at untitled constant. So it means that there is already a range for it and your values can only be defined inside that range. When it goes outside of that range, it displays an error message here. To change this error message to a warning or if you want to not have any of these messages coming, even if my data type is U and 8, you have to go to configuration parameters, dialogues, data validity plane, and you have to set detect overflow.

That basically is configuration parameters and diagnostics, data validity plane, and then we have to go for detect overflow option. So where is my detect overflow? Yes, it is displaying a message as error. So now from error to warning, if I give and if I run it and see this hole, it does not throw anything. It simply does not display any value beyond 255 here. So that is how it is. But that is not the right set of practice. You can see here the latest simulation. It does not display any error message.

But that is the wrong practice. You should not change these configuration parameters as per the will. We usually have to stick around with the fixed configuration parameters. But this is how we usually play with the parameters and with the system. So in this case, since the range is 0 to 255, if you wish to have it beyond 255, say if you wish to have it beyond 0 to 65535 and see, again, it displays an error message. Now it says that you are using data type of Uint 8, but your minimum and maximum that you are defining is out of range.

So what we can do is like we'll quickly go here. We'll either change this to Uint 16, apply and close, or we have to change back to Uint 8. So since our input is 300, we can quickly change it. And you can see here the data type has changed and it is coming as 300. So this is how we basically play with these blocks, constant blocks. When you are doing a large-scale model development, there would be a lot of calibration-related data is available. So in order to handle them all, I think one of the most commonly used blocks is your constant blocks.

And we need to learn to play with them a lot more. OK. So next, we will see how the simout block basically works. So for simout, it's like that is basically here. So OK, two workspace block it is. So here you can define your variable name, what name you wish to have. You can just keep it as simout in this case. And say I'm having a step size input. So I'm clicking on a step size input. And I'll connect it with this. I'm giving the simulation.

Going back to my workspace, throws me a simout here. So this is simout. And this is values that is associated with this. It has some sequence of values since it is a step input between 0 to 10 in steps of 0.2. It has occurred. So here it takes the simulation time from the model and it runs here. So the initial value, final value, all can be defined here. And this is how your whole set of operation here happens. So this is with respect to the simout.

And another one of the most important source is about the signal builder. So in signal builder, as the name suggests, we can play with multiple varieties of signal. If you wish to add more number of signals, more varieties of signals in your model. And especially for doing any kind of high end simulations like the model in loop, software in loop, etc., etc. You're trying to play with so many number of ways. We usually go for this Signal Builder option. So in Signal Builder, we double click on this. It opens Signal Builder window, something like this.

Here you can go and you can save. If you have your set of signals in any Excel sheet or something, you can directly import them from a file. You can click on this import from a file. If you have some set of signals, say five or six signals, and if you want them to be loaded into the Signal Builder, yes, that option is possible. You can also export your data from your Signal Builder. And likewise, if you wish to rename your signals, yes, that is very much possible here.

If you wish to add a new type of signal, say you wish to add a square waveform, you can define the values here and you can add your square waveform. So once it is added here, you can clearly see that the Signal 1, Signal 2, two ports here appear and you can close them. And now you can go for scope. And in scope, it is basically going to display the plot or the graph of it. So what we are doing is like we can double click on the port and this just shows a blank screen about it.

So initially, I'll just add one signal to it. OK. I'm taking another scope here and I'm keeping it like this and trying to simulate my system. Yes. It shows a simple pulse waveform. Now, the real challenge is like if you wish to know more about this, if you wish to zoom in and see the signals and all that, you can click on the zoom option and you can try to see this. Clicking on this option here, you have some screen fit kind of options. The best possible fit is like you have can fit it in all possible directions.

And then from the zoom option, you can select any one of them. That is, you can zoom along X axis or Y axis or you can zoom out. So here, if you wish to zoom along X axis, you can clearly see the pointer changes shape. And if you wish to only zoom and see between timestamp 0 and 1, you choose like this and you zoom like this. So my X axis gets completely changed. It is completely rescaled here and it comes something like this. Now, if you wish to zoom between 0.4 and 0.6, same.

Likewise, we do it here. Also, if you wish to change from X axis to Y axis zoom, you can do the same. If you wish to have between values 1 and 2, yes, it is done here and it is possible here. And the zoom out option, you just click on this. You can zoom out of it. So this is how it is done. Now, the common question that one can ask is like, what if I wish to add in a same single scope block? If I wish to see more number of plots, is it possible?

That kind of question comes up. Yes, it is very much possible to add them. So what we can quickly do is that we open the first scope block. There is at the top corner, you have the settings tab. It has its own configuration parameters. Click on the configuration parameters and click on the number of input ports. If you change it from 1 to 2 and then if you wish to change the output layout, whether you want one top of one another or side by side of one another, you can choose it.

Here I am choosing it as one on top of another. So quickly when you change it for the first input port, the existing scope plot moves to the top half. So the bottom half is empty. I am quickly changing it. If you can clearly see here, the scope block has two ports that is connected here. So now I am quickly making this change and I am connecting it like this. All right. And I click on the run. Yes, this is how it comes. So this is about the scope block, the settings related to the scope block and all the others.

So this is a very, very brief introduction about sources and syncs in a signal. And the most important and the most commonly used blocks here are the imports and the outputs block. We just click and see what these imports and the outputs blocks are. So here again, very similar to your constant block. We can configure with the minimum, maximum. We can configure with the type of data type. If you wish to change the unit related information of it. Yes, that is possible. The port dimensions. If you wish to play with it, you can do signal type.

You can play with it. Whether it can be chosen automatically or it's a real signal or a complex signal. All that can be done. So the most commonly and the most frequently used sources and the sync blocks are the import, output, constant, display, and scope. And for any simulation related purposes, we usually go for the signal builder block. So with this, the current session on sources and sync library has come to an end. And thank you so much.

Part 4

Hello, welcome to today's session on a tutorial of MATLAB Simulink and the topics that we are going to cover today is the math operations, logic and bit operations. So we will have a complete overview on the different libraries which are available in the math operations and logic and bit operations. So now let's quickly go to the topic. So the math operations library, the blocks in this library relate to the mathematical functions as the name suggests. So some of the common blocks that I have displayed here. So they are add, subtract and the sum blocks that again is followed by the product and divide blocks, the gain blocks.

Apart from this, we have the unary minus square root, min max, gain trigonometric functions, et cetera, et cetera. So these are some of the basic math operation library blocks. And then the next is about the array multiplication that we do here. So apart from the normal numerical values, we can also do a matrix multiplication, which is very similar to the logics, whatever we have followed during the scripting sessions, right? Similar logic can be followed here and we can do. So if you can see this screenshot here that we have placed, you can see a matrix input, which when multiplied with a gain value gives you a consistent output.

Likewise, this is like two column matrix. So this is a two row or two column matrix, which when is multiplied with something similar to this, will give you a similar dimensional matrix. So in terms of handling of the dimensions, sometimes even with a matrix or a vector, you can multiply it with a scalar value and then you can give it. So the other mathematical function that we were talking about is the ABS. ABS stands for absolute. Unary minus, it negates the minus value. Bias, when we set the bias limit, it adds a constant value to it.

And apart from that, there are a few other blocks, something like a math function block and trigonometric function block. The math function block has square, square root, logical, reciprocal kind of operations. The same block does where you have to just go and choose the corresponding value. And likewise, when you're going for trigonometric functions, it performs cos, sine, tan related operations, wherein you have to just go and choose the specific sign there. So now let's quickly jump to the MATLAB here and we can have a hands-on session on what's in store.

So here is the new Simulink screen and we have also opened the Simulink library browser. In the Simulink library browser, first we'll go to the math operations and see. So these are the total number of math operation related library blocks. From this, we had only saw a few of them in the presentation slide. The rest of them are here. If you wish to know in detail about what these blocks are, see, as in sine means it's related to the sine function. Matrix concatenate means it's related to matrix concatenation, etc., etc.

But if you wish to know more about it, different properties that is related to it, you can right click on this and you can go to the help for matrix concatenate block. Or you can just right click on this and any block you click, right click on this and go to the help document. It takes you to the corresponding help page, which gives you a complete detailed information on the different properties of this block. Again, ideally here we will just cover what are the important blocks in this demonstration.

And then we'll also cover about the important properties of those key and important blocks. So let's quickly move to MATLAB again. And what I will be doing here is like I first, for example, I'll take for you the ABS block. And ABS is one of the very commonly used blocks in the simulation environment and model development related environment. So in one of the previous lectures, we were talking about the properties and the block parameters and how to access the properties and block parameters for math library blocks as well.

Similar drill is followed. So what we have to do here is like we will directly double click on this block to open the block parameters. Here, one of the important properties that is related to it is like the enable zero crossing detection. So what we do here is like if we wish this property to be enabled or not, we can choose them. And then we can move into the simulink attributes. In simulink attributes, if you wish to set the minimum maximum value, you can numerically set here.

If you wish to change the data type of it here, ideally what data type input is given? The same data type output would be there. Otherwise, if you wish to have only some specific set of data type here, you can choose. And the integer rounding mode property can also be chosen here and saturate on integer overflow. Whether you want the integer value to be overflown or not, this you can choose as well. And in case you are handling any decimal number, in what level this decimal or an integer numeric value must be rounded or not, that can also be chosen here.

So this is with respect to the ABS block. Likewise, quickly we will move to a couple of other blocks as well. So one of them, again, one of the most commonly used blocks is the gain block here. Again, while dragging and pasting, it asks for what you need to have as the gain value. If I am giving 5 as the gain value, the gain value automatically changes here. Otherwise, you can also choose it. And from here, you have what kind of option that you would like to choose.

If you wish the gain to be used in multiplication with just a numerical value. That is here, just a constant block is there and it is getting multiplied means you can choose element wise. Otherwise, there are two options for the matrix wise. That is, you can have a matrix multiplication in two different ways, either with the gain K into U and U into K here. And then that is followed by matrix vector multiplication as well. So here we have the signal parameters. Again, very, very similar drills like your previous ABS block.

The minimum and maximum can be set. Inherit via internal rule is the default one. You can change it as per the requirement or you can play with any one of them as per your requirements and needs. And again, the integer rounding mode is floor by default. And you can choose the one that you require in your operation. Likewise, there is also something called S, the parameter attributes. The parameter attributes here usually stands for the gain values and its related attributes. The signal attributes here stands for the output signal, whatever that goes, right?

The value that comes out of this, it stands for those attributes. That is output minimum and output maximum here. Parameter minimum and parameter maximum usually is related to the gain value data here. And let's now quickly go to the others as well. So what I'm doing is like I'm going to take the addition block. OK, so by default, it takes only two signs. If you wish to add the third sign, you can give it like this. So the third sign is included here. And if you wish to change from plus to minus, that is possible.

If you wish to change from minus to plus, that is again possible. If you wish to change the icon from zero to round, well, that is again possible. So it is all the one you can play with here. It's all up to the requirement and up to the design part of it externally. And apart from that, the signal attributes here in the previous examples, we were talking about the output data type. Here we are not talking about the output data type. Apart from that, we are also talking about the accumulator data type.

The accumulator data type here stands for right the stage before the output data type, the set of inputs, whatever that it takes, the coherent and together the input, whatever that is. If you wish to play with its data type or dimensions or whatever it is, in that case, you will be using the accumulator data type. By default, it is inherit via internal rule. If you wish to change it, et cetera, you can play with them. And apart from that, you have output minimum, output maximum, output data type, floor, et cetera, et cetera.

Right. So and you must be aware of the fact that in the older lectures, we saw how to play with and how to change programmatically the properties of the signals. Let's hope if any of you wish to change programmatically the properties of the signals, kindly go through the previous lectures and then you can get back towards this. So these are some of the basic blocks. I think a couple of more blocks we'll look at it and then we can quickly move into the others. So I'm going for the math function block probably.

Yes. So the math function block is here. I'll double click on the math function block and you can choose which one to play with. If you want log operation, if you want square operation, power operation, mod, reminder, transpose, et cetera, whatever you wish to choose, you can choose from this. It's. Puts all of these engineering and mathematical operations here. And as far as this is concerned, again, the output minimum and output maximum value, if one wishes to use, you can play with here. For a specific operation that you choose, only a specific options would be enabled.

Say, if you are having previously exponential, none of these parameters actually matter, the output data type, et cetera, et cetera. But when you're going for something like a square or when you're going for anything else, I think specifically going for square or mod or anything, you have to play with other numerical data type values here. And hence, we go on to choose the other flags like output data type and integer rounding mode, saturate on integer overflow, everything can be played with. So, in all these blocks, some of the common properties are with respect to the output minimum, output maximum, output data type, and the integer rounding mode.

Most of these values, you have to choose and you have to select them as per the requirement and you have to play with these values. Now, so quickly using some of these blocks, what we can do is that we will implement the Pythagoras theorem and we can see. So, I'll just quickly type the formula of Pythagoras theorem, it is going to be C is equal to square root of A square plus B square. So, this is the formula of the Pythagoras theorem. Now, we can see how to implement this formula.

So, ideally, A square plus B square should be equal to C square. That's the thing behind it. So, let's see how to create this using the available map operations related blocks. Okay. So, what we are going to do here is that I'll take a couple of constant blocks. Yes. So, the first thing I'm giving the name as A. Another constant block I'm taking, I'm giving it as B. Okay. And then what we can do is, since it is a square operation, we are going to go to the math operations block, the math function.

Here, we can double click and we can choose the square operation. And we can drag it and we can place it. And when you're dragging it and placing it, when both of these fall on the same line, a blue color line appears, which means that you can directly click on them so that these lines get connected. Otherwise, you can, after connecting it, once the plus sign appears, you can directly connect the ports here and you can do it. So, we have two outputs, A, B becomes, when multiplied with this becomes A square and B square.

Now, what we have to do is, it's A square plus B square and the whole thing becomes a square root. So, we can use an add block, addition block. And let's just drag this and let's put it this way for representative purposes. We have connected one part of it. The other part of it, let's quickly adjust. We are doing some alignment work here to make them look legible and good. And yes, now, since you have to do square root, let's go back to the math operations and see if this square root is there.

So, let's quickly go to the math operations library block. And yes, there is a square root block. So, we can directly drag the square root block and we'll put it here. And yes, so we can quickly check this. Apart from square root, it also has signed square root and R square root operations. It has a few other properties of it, like the intermediate result and the output result, the integer rounding mode, saturate on integer overflow, etc., etc. And so, finally, let's take a display block here.

So, this display block we'll take and we can name it as C. Now, let's quickly run the simulation here. Yes, 1, 1, square of 1 is 1, square of 1 is 1, 1, 1, it's added to 2, square root of 2 is 1.414. And this is how you basically play with the math operations library blocks. So, next topic that we are going to look at is the logical operations and the bit operations library. So, let's quickly move on to the logical operations blocks here. So, here we have the logic and bit operations.

So, some of the blocks that are shown here, the library blocks, belong to the logic and bit operations. Again, most of them are very much self-explanatory. They are the logical operators, compare to constant, compare to zero, logic operator, relational operator. Predominantly, some of the most commonly used blocks are the compare to constant, compare to zero, and then logic operator and relational operator. So, quickly, let's try to take a look at what these blocks tell us. So, here we have the logical operator. I'll double click on the logical operator.

You can choose not only the AND gate, but you can choose the OR, NAND, NOR, XOR, NOT, whatever that is available. And apart from that, you can also determine the number of inputs that you want. You can also change the shape of it. If you're going for distinctive, it takes the age-old shape like what we would have seen in our textbooks. The default one is the rectangular and the data type part. Since it is a logical operator and gates are involved, usually it takes in zeros and ones as input.

And the default data type value here is Boolean. You cannot play with any other value, obviously. So, this is about the logical operators. Next one is the relational operators. We'll drag the relational operators. And you can double click on this. From this, again, you can choose one of the many. You can choose double equal to. You can choose not equal to. Less than, less than or equal to. Greater than, greater than or equal to. Is infinity. Is not a number. And is finite number. One of them you can choose.

And apart from that, again, the data type is, since it is with the relational operators, the default value is Boolean. And ideally, we can stick with Boolean. We need not change to any other values here. And apart from that, the integer rounding mode is the simplest. That is there. And we can again choose one among the many. The default value that here, it is given as simplest. So, quickly, other library, if any, if we can check. I think we can move to compare to a constant block.

So, let us open a compare to a constant block. It, again, chooses equal to, not equal to, less than, less than, or equal to, greater than, greater than, or equal to. So, if we specify a constant value here, something like, say, 3.0. And I am going to connect it. And I am going to give this output. And let me just run this and see. Okay. This value is less than 3. So, it gives 1. So, now let me change the value to 5. And run and see.

It gives 0. So, this operation is very similar to this operation here. So, you have less than, or equal to. Okay. So, when you are going to do a similar drill, it returns 0. So, this is the ideal purpose of compare to a constant block. And compare to a 0 block, when you drag and you put it, instead of a constant value, it goes for a 0 value. And just replace this one with a 0. And that becomes compare to 0 block. Okay. So, yeah. So, this is how compare to 0 block works.

So, these are some of the common blocks that are in usage. So, now quickly what we can do is like we will try to do a small logical operation. And it's a small engineering related logic. And at the end of the logic, we will try to replicate the same equation using the logical and relational operator symbols. Okay. It is. So, now let's quickly go here. And the logic that we are trying to implement here is like, let's take three inputs. A, B, and C and your B or C, it should do.

And this value, output of it, should be compared in an AND gate with A. Okay. So, if this output is. Satisfied, it can be verified for something like it should be less than, okay, let's have it something like equal to zero. So this is one simple relational operator equation. So this is usually called as the cascaded logic. A part of it is basically called as the cascaded logic. So we will try to replicate this whole in Simulink now. So now let's quickly go back to the Simulink environment.

So what I am doing is, okay, since there is a lot of A, B, and C here, quickly let me give it as X, Y, and Z, okay? So now let's take the inputs X, Y, and Z. We'll rename it as X. We'll rename it as Y. And we can rename the third input for this as Z. So as per the logic, if we can quickly go back, it is Y and Z are with an OR operator. So what we can do is that there is already a block that is available. So Y and Z are with an OR operator.

So let me double click on this. Let me choose OR operator here, okay? And this is connected. So after connecting these two, the output of it is going to be connected to an AND operator. So this is again there. So the output of this is connected now. So this value should be equal to 0. We'll have to check if this value is equal to 0 or not. So here you can choose equal to operator. And then finally, you can click on display operator. So now if you wish to change the output and see, you can see.

And at every stage, if you wish to analyze and see the output, whether the right set of values are coming or not, you can go here at every intermediate position, you can keep display blocks and you can connect them. MATLAB provides this feature of tapping a signal from a particular point and checking the output as well. So now let me check. So since this is an OR operator, output of this should be 1. So this is 1, 1 AND operator should be 1. So since this value is 1 is not equal to 0, the output is 0.

So what I can do is I'm just changing this value. For example, I'm trying to simulate and see, yes, the output of this is 0. This is 1. 0 and 1 gives you 0 output. When compared with this, it gives 1 output. So this is how you technically play with the different logics. So we saw what an equation looks like and how to convert that equation to a model using the mathematical operators and the logical operators. So like this, we can iteratively go and learn about each and every blocks.

And this is how we ideally build logics in our blocks and in our cases. So with this, we have come to an end of today's lecture. And thank you.

Want the rest of Introduction to Model-Based Development using MATLAB and Simulink?

Get the full course syllabus and fees.

The full course is paid (₹40,000). We'll send the syllabus and call you back within one working day.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Full course · paid

Unlock the full Introduction to Model-Based Development using MATLAB and Simulink course

The remaining 9 lessons, mentor-reviewed projects and a certificate come with the paid course (₹40,000). Leave your details: we'll send the syllabus and fees and call you back.

Get the syllabus and fees

A counsellor calls you back within one working day.

By submitting you agree to our Terms and Privacy Policy.

Grow by Skill-Lync · free lesson

Start watching

Free, no payment. Leave your details once and every free lesson on Grow plays straight away. A Skill-Lync counsellor may call you about the full Introduction to Model-Based Development using MATLAB and Simulink course.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.