How can I fill a vector with another one with different size?
7 views (last 30 days)
I want to fill a vector with another vector with different size. like bellow example, that "fullPath" is 201*1 and "xpath" size is 100*1.
I have this error : In an assignment A(I) = B, the number of elements in B and I must be the same.
Could you help me?
Image Analyst on 25 Jul 2015
fullPath(1:length(xpath)) = 2 * xpath;
If you want the left-most elements assigned. Or if you want every other one to be assigned (like it seems like you tried to do), try this:
fullPath(1:2:2*length(xpath)) = 2 * xpath;