1

我有一个使用 SPM8 工具箱的用户编写的 MATLAB 程序。如果直接运行,它工作正常。但是,编译再运行时,出现如下错误:

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

此功能来自与 SPM8 工具箱捆绑的 Fieldtrip 工具箱。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 工具箱。

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

4

1 回答 1

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可以递归添加目录。

于 2017-06-30T08:17:24.060 回答