Create three row vectors:
a = [3 -1 5 11 -4 2] , b = [7 -9 2 13 1 -2] , c = [-2 4 -7 8 0 9]
(a) Use the three vectors in a MATLAB command to create a 3 x 4 matrix
such that the first, second, and third rows consist of the last four elements
of the vectors a, b, and c, res pectively.
(b) Use the three vectors in a MATLAB command to create a 3 x 3 matrix
such that the first, second, and third columns consist of the first three elements of the vectors a, b, and c, respectively.
Create a 6 x 6 matrix in which the middle two rows and the middle two columns
are 1s and the rest of the entries are Os.
Solution
Create three row vectors: a = [3 -1 5 11 -4 2] , b = [7 -9 2 13 1 -2] , c = [-2 4 -7 8 0 9] (a) Use the three vectors in a MATLAB command to create a 3 x 4 matrix such that the first, second, and third rows consist of the last four elements of the vectors a, b, and c, res pectively. (b) Use the three vectors in a MATLAB command to create a 3 x 3 matrix such that the first, second, and third columns consist of the first three elements of the vectors a, b, and c, respectively.Create a 6 x 6 matrix in which the middle two rows and the middle two columns are 1s and the rest of the entries are Os. Solution
การแปล กรุณารอสักครู่..
