A way to replace a single number array to a double array.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Andre
am 3 Apr. 2014
Kommentiert: Andre
am 3 Apr. 2014
Hi, there is a simple way (like array(array(:)==1)=5), to do this:
array=
[ 1
1
0
0
1 ];
to
array=
[ 1 0
1 0
0 1
0 1
1 0 ];
Andre
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 3 Apr. 2014
Bearbeitet: Andrei Bobrov
am 3 Apr. 2014
a=[ 1
1
0
0
1 ];
out = [a, ~a]+0;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Types 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!