Update Webdesigner App Image component- how??
조회 수: 4 (최근 30일)
이전 댓글 표시
I've made a gui and it has an image component that i would like for the image to update automatically (without me having to click it). I've made a matlab scrip that produces a plot and i would like the image component in the gui to update once the image is ploted and stored in some folder. I have a button in the gui called "calculate" and once its clicked that runs the external matlab scrip the creates the plot and saves it as a png. for some reason i can't get the image component to update. is this even possible?
댓글 수: 0
답변 (1개)
Kojiro Saito
2024년 3월 14일
To update an image of uiimage component, change the ImageSource property.
app.Image.ImageSource = 'test.jpg'
But it does not refresh when the image file name is the same as described in Why does uiimage does not update when the file linked to ImageSource changes?
So, if you're using the same file name as an input of ImageSource, imread would do the trick.
testScript; % Run some script and out.jpg will be stored in image folder
app.Image.ImageSource = imread('image/test.jpg'); % Read the image and refresh the Image Component
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!