Splitting a vector into vectors of different length
Show older comments
I want to split a vector with 90 arrays to 5 vectors with different lengths. The length of each vector is determined according to a normalized length like this: nl=[0.1642 .1516 .1259 .5583] Therefore the length of each vector is length=90*[0.1642 .1516 .1259 .5583]. But these lengths are not integer, and if i try to round this the length of will not equal to 90, it might be 89, 90, 91 or even 92 due to round of error. I would appreciate if anyone could assist me to write a code for this.
2 Comments
Geoff Hayes
on 16 Jul 2014
You may need to provide an example. What do you mean by split a vector with 90 arrays?
Alfonso Nieto-Castanon
on 17 Jul 2014
I am guessing you mean "a vector with 90 elements" instead of "a vector with 90 arrays"?
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!