ucdavis / erplab

ERPLAB Toolbox is a free, open-source Matlab package for analyzing ERP data. It is tightly integrated with EEGLAB Toolbox, extending EEGLAB’s capabilities to provide robust, industrial-strength tools for ERP processing, visualization, and analysis. A graphical user interface makes it easy for beginners to learn, and Matlab scripting provides enormous power for intermediate and advanced users.
http://erpinfo.org/erplab
267 stars 73 forks source link

Warning message when starting EEGLAB due to ERPLAB var #107

Closed arnodelorme closed 5 years ago

arnodelorme commented 5 years ago

Description

I get this warning message when starting EEGLAB "Warning: The value of local variables may have been changed to match the globals. Future versions of MATLAB will require that you declare a variable to be global before you use that variable."

This is due to ERPLAB code in the eeg_global function of EEGLAB. How can we remove the warning message (I am maintaining EEGLAB).

if exist('eegplugin_erplab.m')
    global ALLERP; % Javier Lopez-Calderon for ERPLAB
end


Steps to Reproduce

  1. Install EEGLAB and ERPLAB
  2. Start EEGLAB


Expected behavior:

No Warning


Actual behavior:

Warning is displayed


Versions

OS version OSX
Matlab version 2018a
EEGLAB version 2019_0
ERPLAB version v7.0.0
andrewxstewart commented 5 years ago

Hi Arno,

Thanks for reporting this.

Is that snippet from eeglab.m?

Strangely, I'm on (the latest?) EEGLAB v14.1.2 and ERPLAB v7 and I don't get that error. Also Matlab R2018a. EEGLAB_no_error

andrewxstewart commented 5 years ago

Ah - I see. 2019.0 is the latest development version of EEGLAB you are working on.

I do now see this error. I think it only shows once, and then Matlab needs to be restarted to see it again.

This error is produced when eeglab.m calls eeg_global.m.

Error only manifests:

I think this is the first time that eeglab is called again after eegplugin_erplab.m is run.

So I think I can fix this by ensuring that the first use of ALLERP in eegplugin_erplab.m is of the global ALLERP.

Testing this looks like it stops that Matlab warning message!

Could you check that the ERPLAB in this commit fixes this for you? https://github.com/lucklab/erplab/archive/db4a9ca6fd74e070d1f97c5e286e5bb2b970c94b.zip

Cheers, Andrew

arnodelorme commented 5 years ago

Yes no more warning.