The code [r c] = size(trial_03)
returns the number of rows (r
) and columns (c
) of the matrix trial_03
.
In MATLAB, the size()
function is used to get the dimensions of arrays, tables, and variables. The output of size()
is an array containing the length of each dimension of the input.
Using square brackets ([]
) around r c
on the left-hand side of the equals sign captures both values returned by size()
.
For example, if trial_03
is a 3x4 matrix, the code [r c] = size(trial_03)
would set r = 3
and c = 4
.
Here is an example:
main.m270 chars10 lines
This would output:
main.m39 chars3 lines
gistlibby LogSnag