add column to a matriz

1 次查看(过去 30 天)
Hey Guys!
Today I want to do the following:
I count with a random matriz named wp:
wp=rand(3);
wp =
0.1190 0.3404 0.7513
0.4984 0.5853 0.2551
0.9597 0.2238 0.5060
And a column full of -1 named u:
u= (ones(3,1));
u=-1
-1
-1
Now, the thing I want to do is add the column "u" to the matrix as shone below:
-1 0.1190 0.3404 0.7513
-1 0.4984 0.5853 0.2551
-1 0.9597 0.2238 0.5060
Thanks for your time :)

采纳的回答

madhan ravi
madhan ravi 2018-11-13
newmatrix=[u wp]
  2 个评论
Valerie Cala
Valerie Cala 2018-11-13
Thanks, really appreciate it :)
madhan ravi
madhan ravi 2018-11-13
编辑:madhan ravi 2018-11-13
Anytime :)

请先登录,再进行评论。

更多回答(0 个)

类别

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