Bird
Raised Fist0
Simulinkdata~10 mins

Sink blocks (Scope, Display, To Workspace) in Simulink - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a Scope block to the Simulink model.

Simulink
add_block('simulink/Sinks/[1]', 'model/Scope1')
Drag options to blanks, or click blank then click option'
AScope
BGain
CTo Workspace
DDisplay
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Gain' which is not a sink block.
Using 'Display' or 'To Workspace' which are different sink blocks.
2fill in blank
medium

Complete the code to set the variable name for the To Workspace block.

Simulink
set_param('model/To Workspace1', 'VariableName', '[1]')
Drag options to blanks, or click blank then click option'
AoutputData
BscopeData
CinputSignal
DdisplayValue
Attempts:
3 left
💡 Hint
Common Mistakes
Using names that do not reflect output data.
Using names that are not valid MATLAB variable names.
3fill in blank
hard

Fix the error in the code to connect a Display block to the signal line.

Simulink
add_line('model', 'signal1/1', 'Display1/[1]')
Drag options to blanks, or click blank then click option'
AOutput
BOut1
CInput
DIn1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Out1' which is an output port, not input.
Using 'Input' or 'Output' which are not valid port names.
4fill in blank
hard

Fill both blanks to create a To Workspace block and set its SaveFormat parameter.

Simulink
add_block('simulink/Sinks/[1]', 'model/ToWorkspace1'); set_param('model/ToWorkspace1', 'SaveFormat', '[2]')
Drag options to blanks, or click blank then click option'
ATo Workspace
BArray
CStructure
DDisplay
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Display' instead of 'To Workspace' for the block.
Setting SaveFormat to 'Structure' when 'Array' is required.
5fill in blank
hard

Fill all three blanks to add a Scope block, set its number of input ports, and open it.

Simulink
add_block('simulink/Sinks/[1]', 'model/Scope2'); set_param('model/Scope2', 'NumInputPorts', '[2]'); open_system('[3]')
Drag options to blanks, or click blank then click option'
AScope
B2
Cmodel/Scope2
DDisplay
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Display' instead of 'Scope' for the block.
Setting NumInputPorts to a number without quotes.
Opening the wrong system name.

Practice

(1/5)
1. Which Simulink sink block is best for showing a live numeric value during simulation?
easy
A. Display block
B. Scope block
C. To Workspace block
D. Gain block

Solution

  1. Step 1: Understand the purpose of Display block

    The Display block shows numeric values updating live during simulation.
  2. Step 2: Compare with other sink blocks

    Scope shows graphs, To Workspace saves data, Gain modifies signals, so they don't show live numbers directly.
  3. Final Answer:

    Display block -> Option A
  4. Quick Check:

    Live numeric value = Display block [OK]
Hint: Display shows live numbers; Scope shows graphs [OK]
Common Mistakes:
  • Confusing Scope with Display
  • Thinking To Workspace shows live values
  • Selecting Gain which is not a sink block
2. Which of the following is the correct way to configure a To Workspace block to save data as a structure?
easy
A. Set 'Save format' to 'Array'
B. Set 'Save format' to 'Timeseries'
C. Set 'Save format' to 'Structure with time'
D. Set 'Save format' to 'Matrix'

Solution

  1. Step 1: Identify the save format options in To Workspace block

    To Workspace block allows saving data as Array, Structure with time, Timeseries, or Matrix.
  2. Step 2: Choose the option that saves data as a structure

    'Structure with time' saves data as a structure containing time and signals.
  3. Final Answer:

    Set 'Save format' to 'Structure with time' -> Option C
  4. Quick Check:

    Structure save format = 'Structure with time' [OK]
Hint: Structure format is named 'Structure with time' in To Workspace [OK]
Common Mistakes:
  • Choosing 'Array' which saves plain arrays
  • Confusing 'Timeseries' with structure
  • Selecting 'Matrix' which is not a valid option
3. Given this Simulink model snippet:
Signal -> To Workspace block (Save format: Array)

After simulation, what is the format of the saved data in MATLAB workspace?
medium
A. A numeric array containing signal values only
B. A structure with time and signals fields
C. A timeseries object with time and data
D. A cell array with signal data

Solution

  1. Step 1: Understand 'Array' save format in To Workspace block

    When 'Array' is selected, only the signal values are saved as a numeric array without time info.
  2. Step 2: Compare with other formats

    Structure and Timeseries formats include time; cell arrays are not used here.
  3. Final Answer:

    A numeric array containing signal values only -> Option A
  4. Quick Check:

    Save format 'Array' = numeric array [OK]
Hint: Array format saves only values, no time info [OK]
Common Mistakes:
  • Assuming time is saved with Array format
  • Confusing Array with Timeseries
  • Expecting a structure instead of array
4. You added a Scope block but see no graph during simulation. What is the most likely cause?
medium
A. The simulation time is zero
B. The Display block is missing
C. The To Workspace block is set to 'Array' format
D. The Scope block is not connected to any signal

Solution

  1. Step 1: Check Scope block connection

    Scope requires a connected signal to display data; no connection means no graph.
  2. Step 2: Evaluate other options

    Display block absence doesn't affect Scope; To Workspace format doesn't affect Scope display; simulation time zero means no data but usually simulation runs longer.
  3. Final Answer:

    The Scope block is not connected to any signal -> Option D
  4. Quick Check:

    Scope needs signal connection [OK]
Hint: Scope shows graphs only if connected to signals [OK]
Common Mistakes:
  • Thinking Display block affects Scope
  • Confusing To Workspace settings with Scope display
  • Ignoring signal connections
5. You want to analyze simulation data after running a model. Which sink block should you use to save the data for MATLAB post-processing, and how should you configure it to include time information?
hard
A. Use Scope block; enable data logging
B. Use To Workspace block; set 'Save format' to 'Structure with time'
C. Use Display block; no configuration needed
D. Use To Workspace block; set 'Save format' to 'Array'

Solution

  1. Step 1: Identify the sink block for saving data

    To Workspace block is designed to save simulation data to MATLAB workspace for post-processing.
  2. Step 2: Choose the save format to include time

    Setting 'Save format' to 'Structure with time' saves both signal data and time stamps.
  3. Final Answer:

    Use To Workspace block; set 'Save format' to 'Structure with time' -> Option B
  4. Quick Check:

    Save data with time = To Workspace + 'Structure with time' [OK]
Hint: To save with time, use To Workspace + 'Structure with time' [OK]
Common Mistakes:
  • Using Display or Scope blocks to save data
  • Choosing 'Array' format which lacks time info
  • Not configuring save format properly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard