Simple array addition question
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Robert
le 20 Nov 2012
Réponse apportée : Jitesh Kumar
le 26 Sep 2018
if I have a matrix [1,2] and I want to add a 3rd element [3] to make [1,2,3]
And what is this simple manipulation called? 2 hours of searching has got me nowhere.
Kind regards
RK
2 commentaires
Jan
le 20 Nov 2012
Modifié(e) : Jan
le 20 Nov 2012
@Robert: The operation is called "concatenation". Such questions are exhaustively explained in the "Getting Started" chapter of the documentation. While it is strongly recommended to read them, because Matlab is a very powerful language, the forum is not the right place to learn the very basics. Thanks.
Réponse acceptée
per isakson
le 20 Nov 2012
Hint:
x = [ 1, 2 ];
x(end+1) = 3;
or
x = cat( 2, x, 3 );
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!