Passing axes name as an argument then applied to to gca
Afficher commentaires plus anciens
I have recently asked how to pass an axes name to an function and Walter has kindly suggested the following:
function rescaleImage(handles,str)
%
Get image on axes1
axes(handles.axes1)
image1 = getimage(handles.axes1);
%Create handle for new placement of image
%Use str argument to pass the axes handle
imshow(image1,[], 'Parent', handles.(str))
I now want to do something similar but using the same idea doesn't work.
axes(handles.axes1);
delete(findobj(gca,'type','line'))
This works but I want "axes1" to be passed as an argument called str, but when I now try
delete(findobj('Parent', handles.(str),'type','line'))
it fails.
Any advice?
Thanks Jason
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
