11.16: Chapter Exercises

Fundamentals of MATLAB Programming · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    11.16: Chapter Exercises

    Exercise 1: Evaluate an Expression

    Create a Simulink model that evaluates the expression:

    X + 2Y - Z

    Use X = 1, Y = 2, and Z = 3. Display the result using a Display block.

    Exercise 2: Temperature Conversion

    Create a Simulink model that converts temperature from degrees Celsius to degrees Fahrenheit using:

    F = (9/5)C + 32

    Use a Constant block for C, Gain blocks or Product blocks for multiplication, a Sum block for addition, and a Display block for the result.

    Exercise 3: Plot y = cos(x)/x

    Create a Simulink model that plots:

    y = cos(x)/x

    Use x values ranging approximately from -20 to 20. Use a Ramp block to generate x, and use a Scope block to display the result. Adjust the solver step size if the graph is not smooth.

    Exercise 4: Solve a Differential Equation

    Create a Simulink model to solve:

    dx/dt = 3 sin(2t), x(0) = -1

    Use a Sine Wave block, Gain block, Integrator block, and Scope block. Make sure to set the Integrator initial condition to -1.

    Exercise 5: Car Motion

    A car starts moving on a straight road with constant acceleration:

    a = 10 m/s^2

    We know that acceleration is the rate of change of velocity, and velocity is the rate of change of position:

    a = dV/dt
    V = dX/dt

    Complete both parts:

    1. Use MATLAB to plot the velocity and displacement of the car during the first 20 seconds of motion.

    2. Use Simulink to create the same velocity and displacement plots using Integrator blocks.

    Exercise 6: Sine Wave with Noise

    Create a Simulink model for a sine wave with random noise:

    y = 5 sin(2t) + noise

    Use a Sine Wave block, Uniform Random Number block, Sum block, and Scope blocks. Display the sine wave, the noise, and the combined output separately.

    Exercise 7: Export and Plot in MATLAB

    Modify one of your Simulink models so that the output is exported to MATLAB using a To Workspace block. Then create a MATLAB plot of the exported data with a title and axis labels.

    Mini-Project: Modeling a Simple Dynamic System

    Choose one simple dynamic system and create a Simulink model for it. Examples include the temperature of a cup of coffee cooling over time, the speed of a vehicle, the position of a falling object, or the charging of a capacitor. Your model should include at least one source block, one math operation block, one integrator or scope, and one output or display block.

    Your submission should include:

    · A short description of the system being modeled.

    · The equation or relationship used in the model.

    · A screenshot of the Simulink model.

    · A plot of the output.

    · A short explanation of what the plot shows.


    This page titled 11.16: Chapter Exercises was last modified on Tue, 30 Jun 2026 02:11:51 GMT and is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Zara Noroozi.