Extract a Portion of a Vector Based on the Indexes in another Vector
조회 수: 12 (최근 30일)
이전 댓글 표시
Hello!
I hope this can be done. I want to extract a few cells from a first long vector below and place them into the third vector based on the indexes (row numbers) in the second vector......the first column contains the raw values, the second vector contains the indexes of the cells which are to be extracted and the third column shows the result of the extraction....in other words I need the third vector to show the 10th, 20th 30th and so on of the cells in the first vector....
39547.00 10 39560.00
39548.00 20 39574.00
39549.00 30 39588.00
39552.00 40 39602.00
39553.00 50 39616.00
39554.00
39555.00
39556.00
39559.00
39560.00
39561.00
39562.00
39563.00
39566.00
39567.00
39568.00
39569.00
39570.00
39573.00
39574.00
39575.00
39576.00
39577.00
39580.00
39581.00
39582.00
39583.00
39584.00
39587.00
39588.00
39589.00
39590.00
39591.00
39594.00
39595.00
39596.00
39597.00
39598.00
39601.00
39602.00
39603.00
39604.00
39605.00
39608.00
39609.00
39610.00
39611.00
39612.00
39615.00
39616.00
39617.00
39618.00
39619.00
39622.00
39623.00
39624.00
39625.00
39626.00
39629.00
39630.00
39631.00
39632.00
39633.00
39636.00
39637.00
39638.00
39639.00
39640.00
39643.00
39644.00
39645.00
39646.00
39647.00
39650.00
39651.00
39652.00
39653.00
39654.00
39657.00
39658.00
39659.00
39660.00
39661.00
39664.00
39665.00
39666.00
39667.00
39668.00
39671.00
39672.00
39673.00
39674.00
39675.00
39678.00
39679.00
I hope there is a simple solution to this.
Thank you!)
Dave
댓글 수: 0
답변 (1개)
Andrei Bobrov
2012년 1월 11일
A - your vector column (first long vector)
out = A(10:10:end); % your third vector
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!