A = 10 (8, 8) A = 4.02 9.03 7.00 5.75 6.40 6.87 6.76 2.45 3.00 7.32 1.84 2.40 4.
ID: 3823696 • Letter: A
Question
A = 10 (8, 8) A = 4.02 9.03 7.00 5.75 6.40 6.87 6.76 2.45 3.00 7.32 1.84 2.40 4.91 2.42 2.36 6.47 3.68 1.23 4.89 4.04 3.53 4.57 6.25 1.80 3.38 0.26 8.21 5.47 7.80 2.40 9.00 1.32 0.15 2.96 0.51 4.17 3.69 9.42 0.40 7.46 9.29 0.50 1.11 9.50 1.69 1.00 7.78 d = 4.51 6.26 5.47 7.80 5.47 7.80 2.06 0.81 7.45 9.29 1.69 7.78 >> C = A(13: 16) % colon 1 C = >>D = A(12) D = >> E = A(4, 2) E = >>F = % matrix A is one argument F = 7.80 0.60 6.48 6.26 >>G = linspace(20, 30, 6) G = >>H = 20: 2:31 % be careful H = >> min(B) J = 1.69 0.81 Ji = 3 >>K = % mean of matrix B K = 5.42 >> double M = 3.38 9.00 3.69 1.11 3.38 9.00 3.69 1.11 3.38 9.00 3.69 1.11 3.38 9.00 3.69 1.11 N = 7.80 7.80 7.80 7.80 0.60 0.60 0.60 0.60 6.48 6.48 6.48 6.48 6.25 6.25 6.25 6.25 >> P = 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 >> Q = Q = 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 4.89 >> R = B, D % be careful, dot operator R =Explanation / Answer
A = 10 * rand(8, 6) %Creates an array of 8x6 random elements.
To pick the sub array from 4th row to 8, 5th column to 6th column into matrix B, the command is:
B = A(4:8, 5:6)
So, output is:
4.51 6.26
5.47 7.80
2.96 0.81
7.45 9.29
1.89 7.76
C = A(13: 16) %will pick the elements from 13 to 16. column wise.
So, output is:
3.38 9.00 3.69 1.11
D = A(12) % will pick the 12th element from matrix A.
So, the output is:
4.89
E = A(4, 2) % this will also pick the same element as it does in the previous query.
So, the output is:
4.89
F = diag(A, 2) will pick the elements diagonal wise from 2nd column.
So, the output is:
7.80
0.60
6.48
6.26
G = linspace(20, 30, 6) %Will create a total of 6 elements equally spaced in the range [20, 30]
So, the output is:
20 22 24 26 28 30
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.