A way to replace a single number array to a double array.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Andrei Bobrov
le 3 Avr 2014
Modifié(e) : Andrei Bobrov
le 3 Avr 2014
a=[ 1
1
0
0
1 ];
out = [a, ~a]+0;
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Types 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!