Filtering data based index from a cell.

조회 수: 3 (최근 30일)
Hari krishnan
Hari krishnan 2019년 1월 23일
댓글: Hari krishnan 2019년 1월 26일
Hi, I have a matfile as attached. There are cells in the first column and within each cell, i have some data. What if i want to take data from this cell corresponding to indices which are only multiples of 14? Any help will be appreciated.

채택된 답변

Adam Danz
Adam Danz 2019년 1월 23일
Your variable "max_sin_value_part1" is a [40x1] cell array. Each element contains a [1x1] cell array and that cell array contains a vector of doubles.
Here's an example of how to index multiples of 14 from the 6th element of your variable.
max_sin_value_part1{6}{1}(14:14:end)
I suggest you first clean up your variable to get rid of the nested cell arrays.
max_sin_value_part1b = [max_sin_value_part1{:}];
Now the variable such contains a cell array of vectors rather than a cell array of a cell array of vectors. This simplifies the example above to:
max_sin_value_part1b{6}(14:14:end)
  댓글 수: 1
Hari krishnan
Hari krishnan 2019년 1월 26일
@ Adam. Thank you very much. It helped me a lot.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by