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 axes1axes(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
Best Answer