Complete the code to display the value of variable x.
x = 10; disp([1]);
The disp function displays the value of the variable passed to it. Here, passing x shows its value.
Complete the code to create a scope block that shows the signal 'y'.
y = sin(0:0.1:1); scope([1]);
The scope function displays the signal passed to it. Here, y is the signal to show.
Fix the error in the code to display the variable 'z' correctly.
z = 5; disp([1]);
To display the value of z, pass the variable z without quotes to disp.
Fill both blanks to create a scope that displays the square of numbers from 1 to 5.
x = 1:5; y = x[1]2; scope([2]);
* instead of element-wise power.x to scope instead of squared values.The element-wise power operator .^ squares each element of x. The scope displays the squared values stored in y.
Fill all three blanks to create a display of the sum of two vectors a and b.
a = 1:3; b = 4:6; sumVec = a [1] b; disp([2]); scope([3]);
The plus operator + adds vectors a and b element-wise. The result sumVec is displayed and shown in the scope.
