Effacer les filtres
Effacer les filtres

concatenate two columns in matlab

13 vues (au cours des 30 derniers jours)
Fadal Sasse
Fadal Sasse le 10 Août 2017
Commenté : Fadal Sasse le 10 Août 2017
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 commentaires
Stephen23
Stephen23 le 10 Août 2017
Modifié(e) : Stephen23 le 10 Août 2017
Is that a numeric matrix, or a character matrix, or a cell array containing numeric scalars or characters, or a table, or something else?
Fadal Sasse
Fadal Sasse le 10 Août 2017
A numeric matrix

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 10 Août 2017
[A(:,1:end-2), A(:,end-1)*10+A(:,end)]

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by