Open an image when push button is clicked in app designer
Mostra commenti meno recenti
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 ?
Risposta accettata
Più risposte (1)
Amit Patankar
il 17 Mar 2021
0 voti
9 Commenti
Eli Chen
il 17 Mar 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
il 17 Mar 2021
Eli Chen
il 17 Mar 2021
I saw you might have another invalid 'end' above the error line?
Amit Patankar
il 17 Mar 2021
Eli Chen
il 17 Mar 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
il 17 Mar 2021
Eli Chen
il 17 Mar 2021
Is it possible that you upload your app file and let me help debug with?
Amit Patankar
il 17 Mar 2021
Categorie
Scopri di più su Develop Apps Using App Designer in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







