How to obtain data from elements in cell arrays

조회 수: 1 (최근 30일)
Hans123
Hans123 2019년 6월 21일
댓글: Hans123 2019년 6월 21일
I have a cell array A that is a 1x1600 cell.
Each element in the cell has a 2500x3 array.
I need to take the second column of each element as use it in my calculation.
Using A{2} I get the whole second 2500x3 array. What line of code should I write to retrieve only the second column of this 2300x3 array.
Basically I need the (:,2).
I hope I was clear enough.
I am new to cell arrays, would really appreciate help

채택된 답변

Geoff Hayes
Geoff Hayes 2019년 6월 21일
Hans123 - try doing
A{2}(:,2)
to get the second column of the second element of A.
  댓글 수: 1
Hans123
Hans123 2019년 6월 21일
Thanks Geoff, works exactly as I want it to

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by