Update content in sliceViewer without creating new sliceviewer object in parent uipanel (appdesigner)
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Linus Olofsson
am 20 Okt. 2022
Kommentiert: Linus Olofsson
am 23 Okt. 2022
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 Kommentare
Akzeptierte Antwort
Eric Delgado
am 23 Okt. 2022
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!
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!