Today I want to talk about variables, needed by a Simulink model, that are function of other variables.Let's take the simple example of a right triangle:For most Simulink users, if you have a model that requires the length of the hypotenuse or the area of this triangle, you will probably end up writing a script like the following:a = 3;b = 4;c = sqrt(a^2+b^2);area = (a*b)/2;Then, in block parameters, you will use variables c and area:Unrelated side notes regarding the above screenshot:I like to use the Bias block for this type of simple example; it receives a zero from the Inport block and adds the parameter value to it.The yellow rectangles showing the Bias blocks output values are Port Value Displays. Those are useful to debug simulation results without adding blocks to the model.While the
...read more >>