Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

ginput in V2015b is messing with my figure's UserData

1 Ansicht (letzte 30 Tage)
Steve Grobler
Steve Grobler am 25 Jul. 2016
Geschlossen: Steve Grobler am 18 Aug. 2016
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...

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by