To determine the size of a matrix in MATLAB, you can use the size
function. This function returns a vector [m,n]
where m
is the number of rows and n
is the number of columns.
Here is an example code snippet:
main.m109 chars4 lines
This will output:
main.m28 chars2 lines
You can also use the length
function to determine the length of the longest edge if you're dealing with a square matrix.
gistlibby LogSnag