Back to the main page.

Bug 2689 - ft_datatype returns error because function 'fieldnames' is not recognized

Reported 2014-09-18 15:03:00 +0200
Modified 2015-02-11 10:40:11 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: Other
Operating System: Linux
Importance: P5 normal
Assigned to: Robert Oostenveld
Depends on:
See also:

Stan van Pelt - 2014-09-18 15:03:43 +0200

When running ft_prepare_leadfield, this function subsequently calls the subroutines ft_checkdata, ft_datatype, and its subroutine check_chan. This last subroutine gives an error that it does not recognize 'fieldnames' as a function (line 159), although this is a built-in matlab-routine. I am running the latest FieldTrip version (the one om home/common/fieldtrip).

Robert Oostenveld - 2014-09-18 15:13:34 +0200

(hoe heb je dat nu weer voor elkaar gekregen...) fieldnames should indeed be recognised as an normal function: >> which fieldnames.m /Applications/ >> fieldnames(1) Undefined function 'fieldnames' for input arguments of type 'double'. >> fieldnames([]) Undefined function 'fieldnames' for input arguments of type 'double'. >> fieldnames('a') Undefined function 'fieldnames' for input arguments of type 'char'. I cannot reproduce the error. Could you do "dbstop on error" and check the input that you are giving to the field names function? And do "which fieldnames"?

Robert Oostenveld - 2014-09-18 15:14:14 +0200

might there something in general be going wrong on the cluster? I cannot easily check, as I am in Bham.

Stan van Pelt - 2014-09-18 15:24:31 +0200

Yes, strange indeed. "Which fieldnames" does recognize it. I am looking further into this at the moment, trying to replicate the error with other fucntions/platforms. Cluster seems to work fine.. Enjoy Birmingham!

Stan van Pelt - 2014-09-22 10:52:18 +0200

The error was due to putting an empty matrix as input for ft_prepare_leadfield. Ergo, ft_prepare_leadfield(cfg,[]) gives the error as reported (might have worked in previous FT versions?), ft_prepare_leadfield(cfg) works fine.

Robert Oostenveld - 2015-02-11 10:40:11 +0100

Closed several bugs that were recently resolved. Please reopen if you are not happy with the resolution.