Filter löschen
Filter löschen

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

3 Ansichten (letzte 30 Tage)
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?

Akzeptierte Antwort

Nicolai Sanders
Nicolai Sanders am 8 Mär. 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 Kommentare
ajeet verma
ajeet verma am 9 Mär. 2017
thanks for giving me answer but 'flip' is not working instead of this i have tried 'flipud' that give me required result

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type 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!

Translated by