how to replace elements of a matrix position wise?????

2 visualizaciones (últimos 30 días)
suchismita
suchismita el 23 de Jun. de 2014
Comentada: suchismita el 23 de Jun. de 2014
I have a matrix: A=[1 1 0 1; 1 0 1 1; 1 0 0 0; 0 1 0 1] now the elements of 3rd and 4th column i want to change every element as if its 1 than 0 or if its 0 than 1.
please please help me.....

Respuesta aceptada

Dishant Arora
Dishant Arora el 23 de Jun. de 2014
A(:,3:4)=~A(:,3:4)
  3 comentarios
Dishant Arora
Dishant Arora el 23 de Jun. de 2014
A(:,[1,4]) = ~A(:,[1,4])
suchismita
suchismita el 23 de Jun. de 2014
thank you so much

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices 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!

Translated by