Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The length of the vector, B = [0 0 1 2 8 5 21 9 -2 -12 13 0] is: -12 1 8 12 0 Th

ID: 3840848 • Letter: T

Question

The length of the vector, B = [0 0 1 2 8 5 21 9 -2 -12 13 0] is: -12 1 8 12 0 The number of elements in a vector generated by [5:0.01:5] is What value does the variable q contain after the Matlab code below executes? a = [1 0 2] q = a, *a; q = q + 9 [3 11 27] nothing -operation is not possible [1 3 5] [10 9 13] 17 The vector produced from the following command x = logspace (-1, 1, 4) is Which Matlab command allows you to evaluate a polynomial function by supplying the polynomial roots polyval; polyfit; poly; roots plot After the code below executes, what does the variable z contain? aa = logspace (0, pi, 10); z = cos (aa(10)); -1; 0: +1: error not possible; a number that is not -1.0, or +l When inputting a matrix, each row is separated by a:; |, The absolute difference between consecutive numbers in the vector [6:0.2:20] is The dot command (_) in matrix manipulation conducts element to element operations; ends an m file; outputs the scalar value of the dot product; outputs the vector cross product What is the value in y2 when the code shown below executes? x1 = [5 13 79]; [y1 y2] = min (x 1); 3; 5; 1; 2; 9 What value does the variable x contain after the Matlab expression below executes? x = 7/2i.

Explanation / Answer

1) Length of vector : Number of elements in it i.e, 12
And, index will start from (0 to length-1)

2) No of elements generated by [5:0.01:5] is 1
[a:b:c] => a start value
b increment value
c end value
so the only element will be there i.e, 5

3) a = [1 0 2];
q = a.*a ;

% q = each element in q will multiply by itself
% q = [1 0 4]

q = q + 9;

% 9 will added to each element

so, q = [10 9 13]

4) x = logspace(-1,1,4)

% x = logspace(a,b,n) generates n points between decades 10^a and 10^b.

x = [0.10000 0.46416 2.15443 10.00000]

5) r = roots(p)

6) aa = linspace(0,pi,10);
% will generate 0 to pi with 10 elements
% aa = [ 0.00000 0.34907 0.69813 1.04720 1.39626 1.74533 2.09440 2.44346 2.79253 3.14159]
z = cos(aa(10));
% aa(10) => 3.14159

z = cos(pi) = -1

7) semicolon (;)

while inputting matrix, each row is seperated by ;

9) dot command(.) evaluates element to element operations

10) x1 = [5 1 3 7 9];
[y1,y2] = min(x1)

% min(x1) gives minimum value in x1 which stores in y1 and position of minimum value in y2
so y2 = 2

11) x = 7/2i => -3.5i

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote