Back to the main page.
Bug 3145 - ft_nargin between two versions of fieldtrip
Status | CLOSED FIXED |
Reported | 2016-06-14 17:03:00 +0200 |
Modified | 2017-01-17 11:29:46 +0100 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P5 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Fanny Lachat - 2016-06-14 17:03:40 +0200
the newest version of fieldtrip (14th june 2016) calls ft_nargin the previous version of fieldtrip (for example friday 10th of June 2016) does not (but calls "nargin") cfg = []; cfg.correctm = 'no'; cfg.method = 'analytic'; cfg.statistic = 'depsamplesT'; cfg.latency = [0.2 0.7]; cfg.frequency = [8 12]; %, cfg.avgovertime = 'yes' ;% cfg.avgoverfreq = 'yes'; % Nsub = 20; cfg.design(1,:) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfg.design (2,:) = [1:Nsub 1:Nsub]; cfg.ivar = 1; cfg.uvar = 2; Stat_Letter_facevssign_812_27= ft_freqstatistics(cfg, con1{:},cond2{:}); ERROR : (newest fiedltrip version only ) Undefined function or variable 'ft_nargin'. Error in ft_preamble_init (line 34) if ft_nargin==0 Error in ft_preamble (line 56) evalin('caller', ['ft_preamble_' cmd]); Error in ft_selectdata (line 89) ft_preamble init % this will reset ft_warning and show the function help if nargin==0 and return an error Error in ft_freqstatistics (line 117) [varargin{:}] = ft_selectdata(tmpcfg, varargin{:});
Robert Oostenveld - 2016-06-14 18:55:06 +0200
Hi Fanny does the problem persist if you close matlab and start it again? I suspect it to be due to a change in one function, and that MATLAB keeps another related function in memory without updating it, although the code should be "recompiled" as well. Robert
Robert Oostenveld - 2016-06-14 19:31:27 +0200
(In reply to Robert Oostenveld from comment #1) no, I can confirm myself that with a new matlab session it fails.
Robert Oostenveld - 2016-06-14 19:47:42 +0200
(In reply to Robert Oostenveld from comment #2) [master f7de187] FIX - hotfix for nargin/ft_nargin bug, primarily in ft_selectdata but also in other functions. The cause was that these functions were not yet adjusted to the latest state of ft_preamble handling. See http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3145 32 files changed, 129 insertions(+), 40 deletions(-) The obvious error was that ft_selectdata was not yet adjusted to the latest state of the ft_preamble functions, and apparently most other functions in sub-directies (utilities, contrib) were not. The nargin change I made this afternoon assumed that all code was according to the latest standards, and therefore revealed the inconsistency in other functions.
Robert Oostenveld - 2016-06-14 19:48:10 +0200
roboos@mentat001> git push upstream master Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. X11 forwarding request failed on channel 0 Counting objects: 85, done. Delta compression using up to 4 threads. Compressing objects: 100% (43/43), done. Writing objects: 100% (43/43), 6.54 KiB | 0 bytes/s, done. Total 43 (delta 39), reused 0 (delta 0) To git@github.com:fieldtrip/fieldtrip.git daa3ef7..f7de187 master -> master