Info
此问题已关闭。 请重新打开它进行编辑或回答。
ginput in V2015b is messing with my figure's UserData
1 次查看(过去 30 天)
显示 更早的评论
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...
1 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!