fdcdir.m

来自「MATLAB在飞行动力学和控制中应用的工具」· M 代码 · 共 55 行

M
55
字号
function defdir=fdcdir(subdir)
% FDCDIR sets subfolder of the FDC toolbox as default folder.
%
% D = FDCDIR(NAME) returns the complete path of the FDC subfolder
% specified in the string variable NAME to the string variable D.
% The FDC root-folder is extracted from the file FDCINIT.INI, or
% set to the default C:\FDC12 if this INI-file can't be found.
%
% Example: D = FDCDIR('APILOT') and C:\MATLAB\TOOLBOX\FDC13 is
% specified as root folder in FDCINIT.INI.
% This yields: D = 'C:\MATLAB\TOOLBOX\FDC13\APILOT'.
%
% FDCDIR is used by several other FDC programs. See also DATADIR
% and HELPDIR.
%
% Note: the program code itself is based upon generic path and
% file-separators, rather than ':\' and '\'!

% Variables:
% ----------
% defdir    default folder, set by FDCDIR
% rootdir   root-folder of the FDC toolbox
% subdir    subfolder of the FDC toolbox, specified by the user

% If possible, load FDC root-folder from FDC initialization
% file fdcinit.ini. If this file can't be found, use the default
% root-folder C:\FDC12.
% --------------------------------------------------------------
if exist('fdcinit.ini') ~= 2
   rootdir = fullfile(matlabroot,'toolbox','fdc13'); % default FDC root-folder
else
   load fdcinit.ini -mat        % retrieve root-folder from fdcinit.ini
end

if nargin == 0
   defdir = rootdir;
else
   defdir = fullfile(rootdir,subdir);
end

%------------------------------------------------------------------------------
% The FDC toolbox. Copyright Marc Rauw, 1994-2000.
% Last revision of this program: June 15, 1998 (SR1 fix).
%
% Revision history since October 7, 1997:
% =======================================
% October 7, 1997
%   - Used MATLABROOT and FULLFILE commands to define default FDC root-folder
%   - Defined MATLABROOT\TOOLBOX\FDC13 as default root-name
%   - Changed terminology from 'directory' to 'folder' (except in function and
%     file names)
%   - FDCDIR now returns FDC root-directory if called without input arguments
% June 15, 1998
%   - Added comment about path and file-separators for FDC 1.3, SR1.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?