How can I write a matrix 6x1 that the element (2,1) and (6,1) equal to 1 and others are zero?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
reza dehghan
il 8 Ott 2014
Commentato: Star Strider
il 8 Ott 2014
like this : 0 1 0 0 0 1
0 Commenti
Risposta accettata
Star Strider
il 8 Ott 2014
If the vector is ‘A’, this works:
A([2 6]) = 1;
produces:
A =
0 1 0 0 0 1
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Multidimensional Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!