Info

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

Error in ginput/uirestore

1 view (last 30 days)
c
c on 4 Jul 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
I am using the ginput function as a part of a function that selects and highlights a curve on an axis displaying many curves. I have found that in older versions of (Matlab 2010 and older) I receive an error in the function uirestore which is called in ginput when (as a user) I select a point from the axis. The error is as follows:
??? Reference to non-existent field 'WindowKeyPressFcn'.
Error in ==> uirestore at 74 set(fig, 'WindowScrollWheelFcn', uistate.WindowKeyPressFcn)
Error in ==> ginput at 183 uirestore(state);
In later versions of Matlab (2012 and onwards) this error is reduced to a warning but appears in an almost identical fashion. The error and the functions are a bit above my head and I am hesitant to start altering code that is permanently present in matlab. I can't find a record of this error occurring online so I figure I must be at fault but I am calling the function ginput simply as follows:
[x0,y0] = ginput(1);
So I don't understand how this can be different than how it is always used. If anyone has seen this error before or has some advice for how to go about debugging this problem I would greatly appreciate it. If you require copies of the code in order to see what is going on, I am able to provide that as well.
Thanks a lot.
  1 Comment
dpb
dpb on 4 Jul 2014
If I try, I can't cause an error (but I can't manage to ever get precisely on the axis, either, apparently, as I get small values +/- around zero, but never 0.0 identically).
Can you do this reproducibly? If so, how?
OBTW, this is R2012b.

Answers (0)

Community Treasure Hunt

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

Start Hunting!