The code x=[65 65 75 75];
in MATLAB creates a 1-dimensional array/vector named x
which contains four elements. The four elements of x
are 65, 65, 75, and 75. This is equivalent to executing the following code:
main.m60 chars6 lines
Alternatively, you can define x
using the repmat
function as:
main.m27 chars2 lines
This creates a 1-row, 4-column matrix where the first two elements are 65 and the second two elements are 75.
gistlibby LogSnag