How can I write a matrix 6x1 that the element (2,1) and (6,1) equal to 1 and others are zero?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
reza dehghan
am 8 Okt. 2014
Kommentiert: Star Strider
am 8 Okt. 2014
like this : 0 1 0 0 0 1
0 Kommentare
Akzeptierte Antwort
Star Strider
am 8 Okt. 2014
If the vector is ‘A’, this works:
A([2 6]) = 1;
produces:
A =
0 1 0 0 0 1
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!