Info

This question is closed. Reopen it to edit or answer.

ginput in V2015b is messing with my figure's UserData

1 view (last 30 days)
I posted on this before, but its still a problem. Hopefully this explains the problem better than I did last time:
I am using a figure's "UserData" to store a variable so I can access it easily. According to the Matlab documentation, this is a valid approach. Lets say my variable is called "Info", then I store data in the figure like this:
set(gcf,'UserData',Info)
When I want to retrieve the data:
Info = get(gcf,'UserData')
Now the problem is that ginput.m contains this function:
function mode = waitForUserInput(fig)
waitfor(fig,'UserData')
% Extract mode to determine if key or mouse was used
mode = get(fig,'UserData');
if ischar(mode)
ud = strsplit(mode, '_');
mode = ud{1};
end% Reset user data to prepare for next trigger
set(fig,'UserData',[])
end
The above function in ginput.m reads my UserData and then falls over because its not getting the data it expected into its variable "mode". Is there a solution to this problem? In my view, ginput.m should not be using the figure's UserData because that is there for the user to use as required...

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!