필터 지우기
필터 지우기

How to unpack contents of a cell array?

조회 수: 83 (최근 30일)
Elissa
Elissa 2018년 4월 25일
편집: Stephen23 2022년 2월 23일

I have a cell array:

I try to unpack the contents of each cell:

h = size(dom_psth_tb,1);
dom_psth_tb = dom_psth_tb{1:h,1};    

But the result is the contents of only one cell:

Help is much appreciated!

채택된 답변

Stephen23
Stephen23 2018년 4월 25일
편집: Stephen23 2022년 2월 23일
You can use a comma-separated list, and simply concatenate the contents into one matrix:
mat = vertcat(dom_psth_tb{:})
Read this to know more about comma-separated lists:
  댓글 수: 2
Elissa
Elissa 2018년 4월 25일
Thank you!
David Walwark
David Walwark 2018년 8월 8일
The simple solution we all knew existed, thank you.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by