Matrix concatenation from different rows inquiry

In Matlab 2015b, I am trying to combine two row elements in a matrix
For example, let's say I have the matrix:
1 2
3 4
such that all of the above numbers are their own element. In other words, matrix(1,1) = 1, matrix(2,1) = 3
I want to concatenate this so that I simply have:
1.2
3.4
Any help would be greatly appreciated. Thanks!

回答 (1 件)

Chad Greene
Chad Greene 2016 年 3 月 8 日
編集済み: Chad Greene 2016 年 3 月 8 日

0 投票

Is this what you want?
A = [1 2;
3 4];
B = A(:,1)+A(:,2)/10
=
1.2
3.4

1 件のコメント

Micheal Simpson
Micheal Simpson 2016 年 3 月 8 日
Yes!
It's always the simple things that give me the most difficult times..
Many thanks!

この質問は閉じられています。

質問済み:

2016 年 3 月 8 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by