Question: KIn this activity you will learn how to define matrices, use the size ( ) command to find the size % of a matrix,
KIn this activity you will learn how to define matrices, use the size command to find the size of a matrix, generate an identity matrix, and also compute the transpose of a matrix using the operator.
WMatrices in Matlab can be constructed by entering each row of values.
KRows are separated from each other using a semicolon.
For example, consider the times matrix B defined as:
Bleftbeginarraylllllllll
& & & ; & & & &
endarrayright
The size function can be used to compute the number of rows and columns of a matrix. compute the number of rows and columns of B by using the size function and store these values. numRowsTest numColsTest sizeB
The eye function can be used to create an n by n identity matrix.
create the times identity matrix and store it as I.
Ioperatornameeye
The "dottic" operator can be used to transpose a matrix.
Take the transpose of the matrix B and store it as the matrix C
CB prime
Script
Define the times matrix A with all s in the first row, all s in the second row, and all s in the rd row.
Zuse the size function to compute the number of rows and columns of matrix Astore these quantities as variables numRows and numCols.
use the eye function to create the times identity matrix. Store this matrix as I.
Kcompute the transpose of the matrix A Store this transposed matrix as the matrix D Assessment:
Matrix A is correct
numRows variable value is correct
numCols variable value is correct
Identity matrix is correct
Matrix D is correct
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
