How do Index into a structure array and assign columns to a variable
조회 수: 1 (최근 30일)
이전 댓글 표시
I have what looks likes a structure array as output. Each cell of the structure array is n x 5. I wish to attract columns 2, 3, and 4 from each cell and assign them each to a variable.
However to be honest I merely wish to index into each cell, and assign each column to a variable.
These variables will then be inputs to another script. How do I index into each cell and assign columns 2, 3,and 4 to variables D, E, and F for example?
댓글 수: 1
Kian Azami
2017년 10월 8일
Can you put a code of your structure or maybe a picture of your structure when it is opened in the workspace. It is hard to understand what you need to do?
채택된 답변
Walter Roberson
2017년 10월 8일
column2_of_each = cellfun(@(M) M(:,2), TheCellArray, 'Uniform', 0);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!