concatenate two columns in matlab

13 次查看(过去 30 天)
Hi there, I want to concatenate two variables from two columns in matrix into one column, for example, I have these variables
A =
1 4 6 3
2 6 9 9
3 7 8 0
I want to join the last two columns to be like this
1 4 63
2 6 99
3 7 80
How to do that? Thanx
  2 个评论
Stephen23
Stephen23 2017-8-10
编辑:Stephen23 2017-8-10
Is that a numeric matrix, or a character matrix, or a cell array containing numeric scalars or characters, or a table, or something else?

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2017-8-10
[A(:,1:end-2), A(:,end-1)*10+A(:,end)]

更多回答(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