Hi every member,
Overall, I want to get a output from a figure callback after the figure closed. I am doing it by using "assignin". But during I used it, I found a curious problem. Even by assignin('caller'), which is suppose to be a function workspase, the argument always be sent to the base workspace. I have no idea why it happens in this way. Following is my code to illustrate my problem in details. The variable "rx" and "imgx" is a contrast to show my problem.
[X,Y] = ndgrid(1:2*radius+1) ;
img = zeros(2*radius+1);
img(sqrt((X-c0(1)).^2 + (Y-c0(2)).^2) <= radius) = 1;
fig = gcf;
The output in base workspace is suppose to be none. But the "imgx" exist and "rx" not. It seems the caller of the callback is always the base workspace? I am confused about it. If it is so, how could I get a output after the figure deleted in the subfunction workspace?