{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

arrayMix

# arrayMix - %must be placed if the lengths of the two...

This preview shows page 1. Sign up to view the full content.

function both_vectors_interweaved=arrayMix(first_vector,second_vector) %usage: both_vectors_interweaved=arrayMix(first_vector,second_vector) %function that will interweave two vectors first_vector_length=length(first_vector).*2; %the length must be multiplied by 2 in order to account for the zeros that %must be placed if the lengths of the two vectors are different; also, if %the first vector has 4 numbers, then 8 spots need to be available to %interweave it with another vector second_vector_length=length(second_vector).*2; %the length must be multiplied by 2 in order to account for the zeros that
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %must be placed if the lengths of the two vectors are different; also, if %the first vector has 4 numbers, then 8 spots need to be available to %interweave it with another vector both_vectors_interweaved(1:2:first_vector_length)=first_vector; %set equal to first_vector in order to place the elements in the first %vector into the index of the interweaved vector both_vectors_interweaved(2:2:second_vector_length)=second_vector; %set equal to second_vector in order to place the elements in the second %vector into the index of the interweaved vector...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online