Update content in sliceViewer without creating new sliceviewer object in parent uipanel (appdesigner)
4 ビュー (過去 30 日間)
古いコメントを表示
Watch out, I might be justing wrong 'object' terminology - sorry!
I'm using appdesigner and an uipanel container where I want to use sliceViewer(). I create my sliceViewer in a function call (from a button press) and plot the data as
sliceViewer(data,'Parent',app.UIPanel)
This creates a sliceViewer object and shows the data as I want it to. However, after changing the data I want to plot new data in the same sliceViewer, so I use the same line again with updated data. It looks to me as this creates an additional sliceViewer object on top of the last one as I can see overlapping slice numbers like '10/100' overlapped with '27/120'. If possible I would like to write new data to the existing sliceViewer object but I don't know how to. I've tried using handles to the sliceViewer as 'Parent' but I'm getting error messages saying sliceViewer only accepts uipanels or uifigures as parents.
Alternetavley, I've tried to access the children of 'app.UIPanel' using 'allchild(app.UIPanel)' or 'findobj(app.UIPanel)' with different variations to be able to delete the existing sliceViewer, but I can't get that to work either. The closest I get is when I try to delete all children (only the sliceViewer object) using 'delete(findobj(app.UIPanel))' which deletes the entire panel. Here I could re-make the panel again, but this seems like a horrible solution.
0 件のコメント
採用された回答
Eric Delgado
2022 年 10 月 23 日
Wow @Linus Olofsson... this plot visualization is super weird. It seems impossible to update it! A possible solution is to create your own "sliceViewer". See app attached!
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!