COULD YOU PLEASE SOLVE (4.1)AND (4.2 ) BY (MATLAB)? THANK YOU BLEMS ercises that
ID: 2261264 • Letter: C
Question
COULD YOU PLEASE SOLVE (4.1)AND (4.2 ) BY (MATLAB)?
THANK YOU
BLEMS ercises that foll Manipulating Matrices 41 Create the following matrices, and use them in the ex 15 3 22 a=| 3 8 51b=15|c=[12 1852] 14 3 82 (a) Create a matrix called d from the third column of matrix a. (b) Combine matrix b and matrix d to create matrix e, a two-dim o-dimensional matrix with three rows and two columns. (c) Combine matrix b and matrix d to create matrix f, a one-dimensional matrix with six rows and one column. (d) Create a matrix g from matrix a and the first three elements of matrix with four rows and three columns. (e) Create a matrix h with the first element equal to a1,3, the second element equal to q,2, and the third element equal to b21. shown in Table P4.2 and name it thermo_scores. (Enter only the numbers.) Table P4.2 Thermodynamics Test Scores 4.2 Load the file thermo_scores.dat provided by your instructor, or enter the matrix Student No. Test 1 Test 2 Test 3 68 83 61 70 75 82 57 54 67 92 93 68 67 65 69 62 52 34 45 56 65 43 76 65 67 68 92 96 90 89 89 97 94 87 85 45 87 97 95 76 85 62 12 96 78 14 15 16 17 68 72 75 83 89 20 93 91 92 90Explanation / Answer
(4.1)
%%% Matlab code %%%
clc;
clear all;
close all;
a=[15 3 22;3 8 5;14 3 82];
b=[1 5 6]';
c=[12 18 5 2];
%%% a)
disp('Matrix d is : ');
d=a(:,3)
%%% b)
disp('Matrix e is :');
e=[b d]
%%% c)
disp('Matrix f is :')
f=[b;d]
%% d)
disp('Matrix h is :');
h=[a(1,3) c(1,2) b(2,1) ]
OUTPUT:
Matrix d is :
d =
22
5
82
Matrix e is :
e =
1 22
5 5
6 82
Matrix f is :
f =
1
5
6
22
5
82
Matrix h is :
h =
22 18 5
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.