To concatenate two vectors v1
and v2
in MATLAB, you can use the vertcat
or horzcat
functions to create a new vertical or horizontal vector.
For example, let's say we have two vectors v1
and v2
:
main.m28 chars3 lines
To create a new vertical vector v3
that concatenates v1
and v2
, you can use:
main.m22 chars2 lines
The resulting vector v3
will be:
main.m47 chars8 lines
To create a new horizontal vector v4
that concatenates v1
and v2
, you can use:
main.m22 chars2 lines
The resulting vector v4
will be:
main.m42 chars3 lines
gistlibby LogSnag