You can do this using simple indexing in Matlab. Here's how:
main.m26 chars2 lines
This will copy the first element of array1
into the first 20 elements of array2
.
Note that if array2
is not already initialized, you will need to create it first:
main.m141 chars5 lines
This will copy the value 1 from array1(1)
into the first 20 elements of array2
, resulting in array2
being:
main.m52 chars2 lines
gistlibby LogSnag