How do I add a column to a matrix?
Mostra commenti meno recenti
I created a 30x30 matrix and now I want to delete the 1st column of data and add another column replacing the deleted column (which should not replace the same column), so I again get a matrix of size 30x30. I am successful in deleting the 1st column but cannot add another column.
Risposta accettata
Più risposte (1)
Walter Roberson
il 23 Gen 2012
If you know you are going to delete and add a new column in the same place, then just assign the new data overtop of the old data:
Arr(:,1) = NewData;
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!