필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

extract especific part of a cell

조회 수: 1 (최근 30일)
Hamed Jalali
Hamed Jalali 2020년 5월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a 1*10 cell data, say my_cell. Also I have a new index set ind=[2,4,5]. I only need these elements of my_cell, i.e. my_cell{2}, my_cell{4}, my_cell{5}, and save them in a new 1*3 cell, my_cell_new. I used my_cell{ind}, but it returns a different data type (an structure). How can I extract this indices of my_cell with out using for loop?
  댓글 수: 2
BN
BN 2020년 5월 10일
편집: BN 2020년 5월 10일
Did you tried:
NewAnswer = my_cell(ind);
Hamed Jalali
Hamed Jalali 2020년 5월 10일
Thanks. It works. I tried before
NewAnswer = my_cell{ind};
which leads to an incorrect result.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by