A way to replace a single number array to a double array.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Andre
el 3 de Abr. de 2014
Comentada: Andre
el 3 de Abr. de 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 comentarios
Respuesta aceptada
Andrei Bobrov
el 3 de Abr. de 2014
Editada: Andrei Bobrov
el 3 de Abr. de 2014
a=[ 1
1
0
0
1 ];
out = [a, ~a]+0;
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Types en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!