채택된 답변

Voss
Voss 2023년 2월 27일

0 개 추천

M = vertcat(C{:});
where C is your cell array; M will be your big column vector.

추가 답변 (1개)

Image Analyst
Image Analyst 2023년 2월 27일

0 개 추천

Do you want a single very tall column vector, or a 2-D matrix with each column vector in its own column?
Did you try a simple for loop?
for k = 1 : numel(ca) % ca is your cell array
thisCellContents = ca{k};
if ~isempty(thisCellContents)
if k == 1
columnVector = thisCellContents;
else
columnVector = [columnVector; thisCellContents];
end
end
end
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

댓글 수: 1

Lotte Piek
Lotte Piek 2023년 2월 27일
thanks, this was what I was looking for. One more question: if my cell dataset would be two cell row and I wanted two tall colums vector, how would you do that?

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

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2022b

태그

질문:

2023년 2월 27일

댓글:

2023년 2월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by