how to set anti diagonal part of matrix with zero value elements ?

2 visualizaciones (últimos 30 días)
i know that how to set diagonal part of matrix to zero, for that we have a code m=256; n=256; a=ones(m,n); u=triu(a); imshow(u);
but in case of anti diagonal what will be code?

Respuesta aceptada

Nicolai Sanders
Nicolai Sanders el 8 de Mzo. de 2017
I think this might do what you need.
m=256; n=256; a=ones(m,n); u=flip(triu(a)); imshow(u);
Look at the help page for "flip" to see the options.
  2 comentarios
ajeet verma
ajeet verma el 9 de Mzo. de 2017
thanks for giving me answer but 'flip' is not working instead of this i have tried 'flipud' that give me required result

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by