Open an image when push button is clicked in app designer
이전 댓글 표시
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 ?
채택된 답변
추가 답변 (1개)
Amit Patankar
2021년 3월 17일
0 개 추천
댓글 수: 9
Eli Chen
2021년 3월 17일
I saw you have 2 'end' after push button call back function. Can you please check if the last 'end' was valid?
Amit Patankar
2021년 3월 17일
Eli Chen
2021년 3월 17일
I saw you might have another invalid 'end' above the error line?
Amit Patankar
2021년 3월 17일
Eli Chen
2021년 3월 17일
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
2021년 3월 17일
Eli Chen
2021년 3월 17일
Is it possible that you upload your app file and let me help debug with?
Amit Patankar
2021년 3월 17일
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







