how to get the last value of a cell
이전 댓글 표시
Dear Friend,
I generated a series of N by 1 cells with different lengths. I want to generate a new vector, each element of this vector is the last value of the cells.i.e the first value of this vector is the last value of the first cell, the second value of this vector is the last value of the second cell, and so on. anyone can advise me how to achieve this?
댓글 수: 1
Image Analyst
2013년 8월 26일
편집: Image Analyst
2013년 8월 26일
What type/class of variable is in the cells? Characters? double arrays? Structures? Scalar integers?
Have you checked out cellfun()?
채택된 답변
추가 답변 (2개)
Walter Roberson
2013년 8월 26일
NewVector = cellfun(@(v) v(end), YourCellArray)
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!