Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

ginput in V2015b is messing with my figure's UserData

조회 수: 1 (최근 30일)
Steve Grobler
Steve Grobler 2016년 7월 25일
마감: Steve Grobler 2016년 8월 18일
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...

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by