0
0
MATLABdata~10 mins

Why MATLAB is used in engineering and science - Test Your Understanding

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

Complete the code to create a matrix of zeros with 3 rows and 4 columns.

MATLAB
A = zeros([1], 4);
Drag options to blanks, or click blank then click option'
A4
B3
C5
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using the number of columns as the first argument.
2fill in blank
medium

Complete the code to calculate the sine of 45 degrees (in radians).

MATLAB
result = sin([1]);
Drag options to blanks, or click blank then click option'
A45
B90
Cpi/4
Dpi/2
Attempts:
3 left
💡 Hint
Common Mistakes
Using degrees directly without converting to radians.
3fill in blank
hard

Fix the error in the code to compute the mean of vector v.

MATLAB
average = [1](v);
Drag options to blanks, or click blank then click option'
Amean
Bmax
Clength
Dsum
Attempts:
3 left
💡 Hint
Common Mistakes
Using sum or length instead of mean.
4fill in blank
hard

Fill both blanks to create a vector x with values from 1 to 10 with step 2.

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

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

MATLAB
student.[1] = 'Alice'; student.[2] = 20; student.[3] = 95;
Drag options to blanks, or click blank then click option'
Aname
Bage
Cscore
Dgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect field names or typos.