how to clean a panel which contains axes?

O
Ottosaul · Oct 28, 2020 · 1.9K views
Question
I have a function that generates an array of axes but the number of axes that are generated is not constant, neither their position. So, i want every time that main function calls this function, to clean the panel before the new axes will be produced.
Expert Answer
Profile picture of John Michell
John Michell PhD Expert
Answered Aug 26, 2026

You can use findall() to find the children axes

delete(findall(p, 'type', 'axes')); % p is handle of panel
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!