Convert cell array to two row vector

조회 수: 7 (최근 30일)
BOB
BOB 2018년 9월 11일
편집: Stephen23 2022년 2월 23일
Hi folks,
I have the following cell array:
hvix =
[2x1 double]
[2x8 double]
[2x15 double]
[2x1 double]
I want to concatenate them into a 2 x 25 matrix. Is this possible?
Thanks

채택된 답변

Andrei Bobrov
Andrei Bobrov 2018년 9월 11일
cell2mat(hvix(:)')
  댓글 수: 2
monica padala
monica padala 2021년 4월 8일
Hi, I have the following cell array:
M =
[Ax1 double]
[Bx1 double]
[Cx1 double]
[Dx1 double]
[Ex1 double]
Is it possible to concatenate them into 5x4 matrix ?
output = [A B C D E] matrix
Andrei Bobrov
Andrei Bobrov 2021년 4월 9일
M = arrayfun(@(x)rand(4,1),ones(5,1),'un',0)
out = [M{:}]'

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

추가 답변 (1개)

Stephen23
Stephen23 2018년 9월 11일
편집: Stephen23 2022년 2월 23일

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by