Info

此问题已关闭。 请重新打开它进行编辑或回答。

Matrix manipulation

1 次查看(过去 30 天)
Cameron
Cameron 2012-2-12
关闭: MATLAB Answer Bot 2021-8-20
Hi,
I have an array with one value (I.e. dimensions of 1 x 1) and I need to concatenate with other arrays with dimensions (108 x 1).
How do I add the one value to 108 rows? I.e. convert 1 x 1 array to a 108 x 1 array. Thus allowing e to concatenate the arrays.
Thanks, Cameron.

回答(1 个)

Rick Rosson
Rick Rosson 2012-2-12
Please try:
x = rand(108,1);
a = 5;
x(end+1) = a;
Or:
y = [ x ; a ];
HTH.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by