필터 지우기
필터 지우기

how to acces the content of a cell?

조회 수: 2 (최근 30일)
mahrukh jamil
mahrukh jamil 2016년 10월 15일
답변: Walter Roberson 2016년 10월 15일
Hello everyone, So i have never used a cell before. I have a cell of size (1x4800) and in the cell i have 4800, 2x5120 sized double vector. I want to go in to the cell and only access the 2nd row with all columns of the each cell content. i can say like for
cell_segment={2}
segment=cell_segment(2,:);
but the thing is i want to extract this for all the cell content (1x4800). How can I access the information in a loop? Thank you

채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 15일
result = cellfun(@(C) C(2,:), cell_segment, 'Uniform', 0);
If you want to put those all together into a single matrix:
vertcat(result{:})

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by