Add row and column to a interdependent matrix
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Santhosh Chandrasekar
le 19 Fév 2018
Commenté : Santhosh Chandrasekar
le 19 Fév 2018
Hi, how to change the below mentioned 'A' matrix to 'AA' matrix by adding a row and column of 'CR' with the exact values for 'CR' as mention below. For 'CR' all the values in the row from CR to E221 will have 0 and in the column, CR will be zero and E1 to E221 will be 1. I want that string 'CR' also need to be added to the existing headings of E1 to E221 in the row and column wise.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170541/image.jpeg)
0 commentaires
Réponse acceptée
KSSV
le 19 Fév 2018
A = rand(10) ;
AA = zeros(size(A)+1) ;
AA(2:end,2:end) = A ;
AA(2:end,1) = 1 ;
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Random Number Generation 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!