Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

ginput in V2015b is messing with my figure's UserData

1 visualización (últimos 30 días)
Steve Grobler
Steve Grobler el 25 de Jul. de 2016
Cerrada: Steve Grobler el 18 de Ag. de 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...

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by