Eliminate certain entries of cell array

조회 수: 3 (최근 30일)
Mary Hemler
Mary Hemler 2020년 5월 27일
답변: KSSV 2020년 5월 27일
I have a 1x73 cell array, FR, and I would like to eliminate FR {8, 17, 31, 41, 43, 47, 49, 56, 60, 66, 73} and re-save as a 1x62 cell array. How can I do this?
  댓글 수: 2
KSSV
KSSV 2020년 5월 27일
That array FR is repeated for 73-62 = 11 times?
Mary Hemler
Mary Hemler 2020년 5월 27일
Sorry, I don't understand the question. For instance, FR{8} is a vector with all values that are zero, and so are the rest of the entries that I provided above (11 in total). So I want to eliminate FR{8}, FR{17}, FR{31} and so on, for all 11.

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2020년 5월 27일
If C is your cell array and FR has the indices of cells which are to be removed, use:
C(FR) = []

추가 답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 5월 27일
Would it possible to make it array?
a=1:5;
b=1:3;
a=setdiff(a,b)

카테고리

Help CenterFile Exchange에서 Performance and Memory에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by