BCILAB icon indicating copy to clipboard operation
BCILAB copied to clipboard

Undefined function or variable 'hFig'.

Open brianbaloch opened this issue 7 years ago • 13 comments

I am using BCILAB-devel-1.4 version. it has only one problem. it gives an error of undefined function or variable 'hFig' . below is given error Error in vis_artifacts/on_resize (line 299) wPos = get(hFig,'Position');

brianbaloch avatar Aug 15 '16 15:08 brianbaloch

Just for convenience's sake, here is a link to the offending line.

If you put a break point on line 169, after hFig is created but before on_resize is called, does hFig exist? (I'm actually checking to see if on_resize somehow gets called before hFig is created)

cboulay avatar Aug 15 '16 15:08 cboulay

when I wrote dbstop in on_resize; after line 169. i got same error

brianbaloch avatar Aug 15 '16 15:08 brianbaloch

Sorry, not after line 169. I meant immediately before line 169. (I use the Matlab IDE and just click on the margin of the line I want to break, hence why I said "on", but really it's right before that line).

cboulay avatar Aug 15 '16 16:08 cboulay

ok dear

brianbaloch avatar Aug 15 '16 16:08 brianbaloch

dear figure is empty

brianbaloch avatar Aug 15 '16 16:08 brianbaloch

dear figure is empty . and giving the following errors . I mean same error.

# Undefined function or variable 'hFig'. Error in vis_artifacts/on_resize (line 301) wPos = get(hFig,'Position'); Error in vis_artifacts/on_window_resized (line 313) on_resize(); Error using vis_artifacts (line 167) Error while evaluating Figure SizeChangedFcn You might see this error due to a behavior change in the ResizeFcn callback. See ResizeFcn Returns Error After GUI Launches for more information.

brianbaloch avatar Aug 15 '16 16:08 brianbaloch

These are the same errors which i get after break point (just before the line 169).

brianbaloch avatar Aug 15 '16 16:08 brianbaloch

OK, the error message explains it. While I don't have BCILAB installed to confirm, my guess is it is the same error as described here.

Can you confirm that you're running a version of Matlab >= R2014b?

Right after hFig is set on line 167, add the following: set(hFig, 'Visible','on');

cboulay avatar Aug 15 '16 16:08 cboulay

I am using MATLAB 2015b

brianbaloch avatar Aug 15 '16 16:08 brianbaloch

Error is still there. sir please need your help

brianbaloch avatar Aug 15 '16 16:08 brianbaloch

Sorry, I don't have BCILAB installed. I was just going based on the errors you described. Compare the code in your vis_artifacts.m file to the one currently in the devel branch of this repository to see if they are identical around lines 167-169. If they aren't then my advice will not work because the edits will have to happen on slightly different lines.

Other than that I can't help you.

cboulay avatar Aug 15 '16 16:08 cboulay

Thanks Sir

brianbaloch avatar Aug 15 '16 16:08 brianbaloch

Thanks. But the problem is still existing. I checked by comparing it to current devel branch of repository.

brianbaloch avatar Aug 15 '16 17:08 brianbaloch