the reset and complement functions don't work even though I wrote the codes for them correctly
app.UIAxes.cla;
app.UIAxes2.cla;
app.img = "";
app.img2 = "";
app.img2 = imcomplement(app.img);
imshow(app.img2 , 'Parent', app.UIAxes2);

 Respuesta aceptada

Image Analyst
Image Analyst el 12 de Dic. de 2022

0 votos

Not sure of your definition of "correctly". Yes, that won't give a syntax error, but it's not correct.
You are setting two global variables (fields of the global app variable): img and img2. These are set to the null string.
imcomplement takes an image variable as an input -- an actual numerical matrix, not a character string.

5 comentarios

nour
nour el 12 de Dic. de 2022
Movida: Image Analyst el 12 de Dic. de 2022
So how should I solve this problem?
Image Analyst
Image Analyst el 12 de Dic. de 2022
Did you try just deleting these two lines:
app.img = "";
app.img2 = "";
If those fields are really image arrays, then it should work, once you don't redefine them to be null strings.
nour
nour el 13 de Dic. de 2022
this what happens when I press the resetbutton
Image Analyst
Image Analyst el 13 de Dic. de 2022
Try
cla(app.UIAxes);
nour
nour el 13 de Dic. de 2022
it worked thank you very much

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 12 de Dic. de 2022

Comentada:

el 13 de Dic. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by