Back to the main page.

Bug 2976 - ft_preamble and ft_postamble are not fully supported on matlab 2015b

Status CLOSED FIXED
Reported 2015-10-02 21:27:00 +0200
Modified 2016-06-14 16:14:49 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks: 2989
See also:

Teresa Madsen - 2015-10-02 21:27:19 +0200

My script runs the line: >> data = ft_rejectartifact(cfg,data); And gets the error: Reference to a cleared variable data. Error in ft_rejectartifact (line 520) cfg = data; I tracked it down to ft_postamble_savevar, line 48: if ~nargout % do not return the output variable "ans" clear(ft_default.postamble{1}); end The Matlab editor gives a warning: Use of 'nargout' in a script will be removed in a future release. Since this is a script, I'm not exactly sure where it's supposed to be getting the nargout from, but my call to ft_rejectartifact did request an output, so I guess it should be there. I've run this code successfully for a while now, and just ran into this problem *I think* when I upgraded to R2015b, so it may be a change in how this release handles something. I did try updating to the latest version of FieldTrip (9/30/15) to be sure it wasn't something you had already found and fixed. Let me know if you're able to replicate the problem or need any more info. Thanks, Teresa


Teresa Madsen - 2015-10-05 18:08:02 +0200

Just thought I'd add, it still crashes (on the same line & with the same error) when I run ft_rejectartifact without an output variable. My workaround is just to leave cfg.outputfile off and save the data after.


Robert Oostenveld - 2015-10-11 09:19:17 +0200

(In reply to Teresa Madsen from comment #1) Hi Theresa, I made some updates to the pre and postamble handling on Friday. It mainly had to do with ordering, and not with the error you reported. See https://github.com/fieldtrip/fieldtrip/commit/1c51eaf2bcc7a41103e5f7b8c42fb9129916d93b But I also noticed the 2015b warning. So far we have not yet targeted version 2015b, but we should. I have renamed the bug description and will try to pinpoint the problems with the post amble and 2015b.


Robert Oostenveld - 2015-11-23 17:04:10 +0100

(In reply to Robert Oostenveld from comment #2) I made a test script and just tried to replicate with the latest version on matlab r2015b on 64-bit OS X. >> test_bug2976 detected 1 manual artifacts rejected 2 trials completely rejected 0 trials partially filled parts of 0 trials with nans resulting 18 trials the input is raw data with 10 channels and 20 trials Warning: Original data has trialinfo, using user specified trialinfo instead > In ft_warning (line 181) In ft_redefinetrial (line 256) In ft_rejectartifact (line 504) In test_bug2976 (line 29) the call to "ft_redefinetrial" took 0 seconds and required the additional allocation of an estimated 0 MB the call to "ft_rejectartifact" took 0 seconds and required the additional allocation of an estimated 0 MB All runs as it should, so I'll close the bug. mac011> svn commit test_bug2976.m Adding test_bug2976.m Transmitting file data . Committed revision 10932.


Robert Oostenveld - 2016-06-14 16:14:49 +0200

Hereby I am closing multiple bugs that have been resolved for some time now. If you don't agree to the resolution, please reopen.