Unrecognized function or variable 'fileparts'

5 ビュー (過去 30 日間)
Melody
Melody 2022 年 9 月 15 日
コメント済み: Walter Roberson 2022 年 9 月 15 日
Hi, i tried to use the fileparts() function in this code :
function [b] = initialize_vars(subject,group, intervention)
% SPM info
%--------------------------------------------------------------------------
%b.spmDir = fileparts(which('spm')); % path to SPM installation
b.spmDir = fileparts('/Applications/MATLAB_R2021b.app/toolbox/spm12/spm.m'); % path to SPM installation
But i got this error :
Unrecognized function or variable 'fileparts'.
Error in initialize_vars (line 15)
b.spmDir = fileparts('/Applications/MATLAB_R2021b.app/toolbox/spm12/spm.m'); % path to SPM installation
Error in main_Preproc1st_Mind2_NF2 (line 86)
b = initialize_vars(groups{g}{i}, groups{g}{end}, interv{i_int});
  2 件のコメント
Rik
Rik 2022 年 9 月 15 日
There seems to be something very wrong with your installation. Did you try restarting it? These are internal errors. The fileparts function is a core function, so if it is missing, something is seriously harming the normal operation of Matlab.
I once had a function called 'settings' in my working directory. That blocked access to vital parts of Matlab, including the editor. Such things could also cause strange errors like this.
Walter Roberson
Walter Roberson 2022 年 9 月 15 日
Experiment with
restoredefaultpath; rehash toolboxcache

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by