how to produce a logical matrix using index matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Khairul Nur
am 24 Okt. 2019
Bearbeitet: per isakson
am 24 Okt. 2019
Hi, i need some help here, im also new in matlab. i have 'b' containing index matrix for example b=1; i want to create logical matrix and should be [1 0 0 0]
if i have b = 2, the matrix will be [0 1 0 0]. Hope i find some solutions. TQIA
0 Kommentare
Akzeptierte Antwort
per isakson
am 24 Okt. 2019
Try
logical_matrix = false( 1, 4 );
logical_matrix( b ) = true;
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices 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!