How to replace zero with a number in null matrix at required position
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A simple case like this

I want to replace the some elements with other numbers like this

0 commentaires
Réponse acceptée
Raj
le 19 Juin 2019
I see no specific pattern in your modified matrix. So just use proper indexing to insert the required number at required location.
A=zeros(5)
A(1,5)=7
A(2,2)=8
A(3,5)=2
A(4,2)=4
A(5,3)=1
Its quite trivial so I am not sure if this is what you are looking for.
Plus de réponses (0)
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!