Make vector into matrix matlab

broken image
broken image
broken image

Swap the two halves of v to make a new vector: v2 = v() % Extract and swap the halves of v

broken image

The colon notation in MATLAB provides an easy way to extract a range of elements from v: v(3:7) % Extract the third through the seventh elements Or the subscript can itself be another vector: v() % Extract the first, fifth, and sixth elements The subscript can be a single value: v(3) % Extract the third element Let's start with the simple case of a vector and a single subscript.

broken image