What does this matlab statement mean?

Regarding the following Matlab statement shown here http://www.mathworks.com/help/images/ref/imopen.html:
figure, imshow(I_opened,[])
What do 'figure' and '[]' mean in the statement?
Thanks.

 Respuesta aceptada

Matt Fig
Matt Fig el 10 de Oct. de 2012
Editada: Matt Fig el 10 de Oct. de 2012

1 voto

The FIGURE command creates a new MATLAB figure, and the [] is passing an empty argument to the second input of the IMSHOW function.
From the help for IMSHOW:
" If you use an empty matrix ([]) for [low high], imshow uses [min(I(:)) max(I(:))]; that is, the minimum value in I is displayed as black, and the maximum value is displayed as white."

Más respuestas (1)

Doug Hull
Doug Hull el 10 de Oct. de 2012

0 votos

The brackets are a null input. They are the empty matrix. In cases like this the function is likely demanding an input, but they have nothing to give. They could be dropped in this specific case.
Figure opens a new figure.

1 comentario

Image Analyst
Image Analyst el 10 de Oct. de 2012
Using or not using [] in imshow has a huge effect. It says whether to scale the display to the min and max of the data rather than scaling the default range assumed for that class. Really makes a huge difference especially for floating point images.

Iniciar sesión para comentar.

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 10 de Oct. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by