编译的MATLAB错误:未定义的函数'ft_datatype_sens'用于'struct'类型的输入参数

时间:2017-06-21 12:19:41

标签: matlab mcc spm

我有一个由我的用户编写的MATLAB程序,它使用SPM8工具箱。如果直接运行,它工作正常。但是,在编译然后运行时,会发生以下错误:

Undefined function 'ft_datatype_sens' for input arguments of type 'struct'

此功能来自Fieldtrip工具箱,该工具箱与SPM8工具箱捆绑在一起。 startup.m包含以下内容:

if(isdeployed==false)
    addpath(genpath('/cm/shared/apps/matlab/spm/08'))
    spm('defaults', 'eeg')
    spm_get_defaults('cmdline',true)
    disp('SPM path is set')
end

我自己不是MATLAB用户,我在黑暗中摸索,但我的假设是没有找到Fieldtrip工具箱。

任何人都可以对此有所了解吗?

1 个答案:

答案 0 :(得分:1)

解决方案是需要通过选项-I

明确给出必要的目录
mcc -C -mv -R -singleCompThread -R -nodisplay -I /cm/shared/apps/matlab/spm/08/ -I /cm/shared/apps/matlab/spm/08/spm_orthviews -I /cm/shared/apps/matlab/spm/08/config -I /cm/shared/apps/matlab/spm/08/matlabbatch -I /cm/shared/apps/matlab/spm/08/matlabbatch/cfg_confgui -I /cm/shared/apps/matlab/spm/08/matlabbatch/cfg_basicio -I /cm/shared/apps/matlab/spm/08/matlabbatch/cfg_basicio/src -I /cm/shared/apps/matlab/spm/08/matlabbatch/examples -I /cm/shared/apps/matlab/spm/08/src -I /cm/shared/apps/matlab/spm/08/toolbox -I /cm/shared/apps/matlab/spm/08/toolbox/mixture -I /cm/shared/apps/matlab/spm/08/toolbox/spectral -I /cm/shared/apps/matlab/spm/08/toolbox/Seg -I /cm/shared/apps/matlab/spm/08/toolbox/Beamforming -I /cm/shared/apps/matlab/spm/08/toolbox/DEM -I /cm/shared/apps/matlab/spm/08/toolbox/DARTEL -I /cm/shared/apps/matlab/spm/08/toolbox/MEEGtools -I /cm/shared/apps/matlab/spm/08/toolbox/Neural_Models -I /cm/shared/apps/matlab/spm/08/toolbox/dcm_meeg -I /cm/shared/apps/matlab/spm/08/toolbox/SRender -I /cm/shared/apps/matlab/spm/08/toolbox/Shoot -I /cm/shared/apps/matlab/spm/08/toolbox/HDW -I /cm/shared/apps/matlab/spm/08/toolbox/FieldMap -I /cm/shared/apps/matlab/spm/08/EEGtemplates -I /cm/shared/apps/matlab/spm/08/canonical -I /cm/shared/apps/matlab/spm/08/rend -I /cm/shared/apps/matlab/spm/08/apriori -I /cm/shared/apps/matlab/spm/08/templates -I /cm/shared/apps/matlab/spm/08/external -I /cm/shared/apps/matlab/spm/08/external/fieldtrip -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/plotting -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/fileio -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/statfun -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/src -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/connectivity -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/inverse -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/specest -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/forward -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/utilities -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/preproc -I /cm/shared/apps/matlab/spm/08/external/fieldtrip/trialfun -I /cm/shared/apps/matlab/spm/08/external/yokogawa -I /cm/shared/apps/matlab/spm/08/external/eeprobe -I /cm/shared/apps/matlab/spm/08/external/mne -I /cm/shared/apps/matlab/spm/08/external/ctf -I /cm/shared/apps/matlab/spm/08/external/bemcp -I /cm/shared/apps/matlab/spm/08/tpm myprog.m

可以通过使用选项-a来减少需要指定的目录数,这可以递归地添加目录。