Display a matrix as an image with boundaries(borders) between different components

3 visualizaciones (últimos 30 días)
I have a matrix like the first image that changes with each step.
To display this matrix as an image, the imagesc or other commands only displays as a color image, but I want the boundaries(borders) to be displayed automatically as well, because this matrix changes at every step, and if the borders are not detected automatically, it will be useless.
1- Please help me how I can display this matrix with its boundaaries (borders) automatically like the following images with and without color ?

Respuestas (1)

KSSV
KSSV el 3 de Jun. de 2021
  3 comentarios
HG
HG el 7 de Jun. de 2021
S=[1 1 1 1 5 5 5 5 5 5;
1 1 1 1 1 5 5 5 5 5;
1 1 1 1 1 5 5 5 5 5;
1 1 1 1 5 5 5 5 2 2;
1 1 1 1 5 5 5 2 2 2;
1 1 1 4 4 5 2 2 2 2;
4 4 4 4 4 4 2 2 2 2;
4 4 4 4 4 2 2 2 2 2;
4 4 4 4 4 2 2 2 2 2;
4 4 4 4 4 2 2 2 2 2];

Iniciar sesión para comentar.

Categorías

Más información sobre Display Image 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