Create a script file*** called Lecture_2A in which you complete these exercises.
ID: 3782090 • Letter: C
Question
Create a script file*** called Lecture_2A in which you complete these exercises. Define the following matrices: A = [2 9 0 0 b = [1 a = [4 20 29 21] Calculate the following (when defined): a. A*b b. a + 4 c. b*a d. a*b^T e. A*a^T Explain any differences between the answers that MATLAB gives you when you calculate A*A, A^2, and A.^2. What is the command that isolates the submatrix that only contains the 1^st and 2^nd of matrix A. Solve the linear system Ax = b for x. Check your answer by multiplication.Explanation / Answer
A=[2 9 0 0
1 3 8 11
6 4 2 7
2 6 5 19];
b=[1
2
8
5];
a=[4 20 29 21];
ans1=A*b;
ans2=a+4;
ans3=b*a;
B = transpose(b); %%taking transpose
C=transpose(a);
%ans4=a*B;
ans5=A*C;
ans6=A*A;
ans7=A^2;
ans8=A.^2;
ans9=A([1 2],[1 2 3 4]); % taking 1 and 2 row and 1 2 3 4 colmn
ans10= mldivide(A,b); %mldivide solve ax=b type of equation
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.