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

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

View Full Document Right Arrow Icon
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
Background image of page 1
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

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online