Open an image when push button is clicked in app designer
Mostrar comentarios más antiguos
HI !
I have a push button in the app. I want the push button to open an image file ( file name will be pre-defined in the code) .
I do not want to browse the image file.
What syntax should I use to get this worked ?
Respuesta aceptada
Más respuestas (1)
Amit Patankar
el 17 de Mzo. de 2021
0 votos
9 comentarios
Eli Chen
el 17 de Mzo. de 2021
I saw you have 2 'end' after push button call back function. Can you please check if the last 'end' was valid?
Amit Patankar
el 17 de Mzo. de 2021
Eli Chen
el 17 de Mzo. de 2021
I saw you might have another invalid 'end' above the error line?
Amit Patankar
el 17 de Mzo. de 2021
Eli Chen
el 17 de Mzo. de 2021
Ok. It looks like the 'end' is not causing problem. Can you revert your changes(adding those end back) and try to comment out the pushbutton callback content? Like:
function showImage(app, event)
% img = imread('MatlabLogo.png');
% image(img);
end
If this still causes 'Unexpected Matlab Expression' error, then the problem could be you have created the pushbutton click callback funtion in wrong way
Amit Patankar
el 17 de Mzo. de 2021
Eli Chen
el 17 de Mzo. de 2021
Is it possible that you upload your app file and let me help debug with?
Amit Patankar
el 17 de Mzo. de 2021
Categorías
Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







