? 發問時間: 電腦與網際網路軟體 · 1 0 年前

MATLAB如何判斷一個目錄或檔案是否存在

MATLAB如何判斷一個目錄或檔案是否存在?

我要測試的function,不是mkdir本身

1 個解答

評分
  • 1 0 年前
    最佳解答

    if exist(dirname,'dir')

    else

    end

    Matlab search throught all the path, and database is one of the

    database toolbox directory.

    For me :

    >> which('database')

    c:\palette\apl\matlabv7r3\toolbox\database\database\@database\database

    .m

    Maybe that's the reason why...

    If you want to know if database doesn't exist in your current

    directory you should do :

    exist(fullfile(pwd,'database'),'dir')

    from

    http://newsreader.mathworks.com/WebX/.ef5af0c?50@6...

    • Commenter avatar登入以對解答發表意見
還有問題?馬上發問,尋求解答。