0
0
MATLABdata~10 mins

Why operators drive computation in MATLAB - Test Your Understanding

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

Complete the code to multiply two numbers and store the result.

MATLAB
result = 5 [1] 3;
Drag options to blanks, or click blank then click option'
A*
B+
C-
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using + instead of * results in addition, not multiplication.
2fill in blank
medium

Complete the code to subtract 4 from 10.

MATLAB
difference = 10 [1] 4;
Drag options to blanks, or click blank then click option'
A-
B*
C+
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using + adds numbers instead of subtracting.
3fill in blank
hard

Fix the error in the code to divide 20 by 5.

MATLAB
quotient = 20 [1] 5;
Drag options to blanks, or click blank then click option'
A*
B+
C/
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using * multiplies instead of dividing.
4fill in blank
hard

Fill both blanks to create a vector with elements from 1 to 10, stepping by 2.

MATLAB
vec = [1]:[2]:10;
Drag options to blanks, or click blank then click option'
A1
B2
C3
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 3 as step skips numbers incorrectly.
5fill in blank
hard

Fill all three blanks to create a structure with fields 'name', 'age', and 'score'.

MATLAB
student = struct('[1]', 'Alice', '[2]', 20, '[3]', 95);
Drag options to blanks, or click blank then click option'
Aname
Bage
Cscore
Dgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'grade' instead of 'score' changes the field name.