To find the number of rows of a matrix in Matlab, you can use the size
function with the second argument set to 1 to represent the number of rows. For example:
64 chars4 lines
Output:
2 chars2 lines
Here, size(A, 1)
gives the number of rows of matrix A
, which is 3 in this case. We store the output in the variable numRows
and then display it using the disp
function.
gistlibby LogSnag