Convert cell array to two row vector

10 次查看(过去 30 天)
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 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by