Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in MATLAB path set by ft_defaults #2343

Open
gllmflndn opened this issue Nov 14, 2023 · 3 comments
Open

Change in MATLAB path set by ft_defaults #2343

gllmflndn opened this issue Nov 14, 2023 · 3 comments

Comments

@gllmflndn
Copy link
Contributor

I observe that the MATLAB path changes when ft_defaults is called twice - in particular, the paths to the MATLAB toolbox replacements get removed.

In this example, MATLAB's ver reports this:

>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.13.0.2049777 (R2022b)
-----------------------------------------------------------------------------------------------------
MATLAB                                                Version 9.13        (R2022b)                              
FieldTrip                                             Version unknown     www.fieldtriptoolbox.org
Image Processing Toolbox                              Version 11.6        (R2022b)                   

If ft_defaults is called a first time, MATLAB's path contains:

>> path

		MATLABPATH
[...]
	/home/github/fieldtrip/external/fileexchange
	/home/github/fieldtrip/external/stats
	/home/github/fieldtrip/external/signal
	/home/github/fieldtrip/utilities
	/home/github/fieldtrip

If I then call:

clear all
ft_defaults;

MATLAB's path now does not have the stats and signal toolbox any more:

>> path

		MATLABPATH

[...]
	/home/github/fieldtrip/external/fileexchange
	/home/github/fieldtrip/utilities
	/home/github/fieldtrip
	/home/github/Documents/MATLAB
@robertoostenveld
Copy link
Contributor

Could you check what your ft_default global variable is at the different stages? I suspect that the ft_default.toolbox.signal options are different at the moment the path is handled, and that your clear all clears the global variable.

@robertoostenveld
Copy link
Contributor

>> restoredefaultpath
>> which filtfilt
/Applications/MATLAB_R2023b.app/toolbox/signal/signal/filtfilt.m
>> ft_defaults
...
>> which filtfilt
/Users/roboos/matlab/fieldtrip/external/signal/filtfilt.m
>> clear all
>> ft_defaults
...
>> which filtfilt
/Users/roboos/matlab/fieldtrip/external/signal/filtfilt.m

for me it remains consistent, because of the detection of the 38957 license.

@gllmflndn
Copy link
Contributor Author

Here is what I see with the same example (the Signal Processing Toolbox is not installed):

>> restoredefaultpath
>> which filtfilt
'filtfilt' not found.
>> addpath /home/github/fieldtrip
>> ft_defaults
...
>> which filtfilt
/home/github/fieldtrip/external/signal/filtfilt.m
>> clear all
>> ft_defaults
...
>> which filtfilt
'filtfilt' not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants