Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of slmkdir
Home > sltoolbox > fileio > slmkdir.m

slmkdir

PURPOSE ^

SLMKDIR Makes a directory if it does not exist

SYNOPSIS ^

function dirpath = slmkdir(dirname, parentpath)

DESCRIPTION ^

SLMKDIR Makes a directory if it does not exist

 $ Syntax $
   - dirpath = slmkdir(dirname)
   - dirpath = slmkdir(dirname, parentpath)

 $ Arguments $
   - dirname:      the name (relative path) of the diretory (r.t parent)
   - parentpath:   the path of the parent directory
   - dirpath:      the path of the created directory (r.t. '')

 $ Description $
   - dirpath = slmkdir(dirname) makes a diretory of given name if it
     does not exist.

   - dirpath = slmkdir(dirname, parentpath) makes a diectory of given 
     name if it does not exist, relative to parent path.

 $ History $
   - Created by Dahua Lin, on Aug 12nd, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
  • sladdpath SLADDPATH Adds dirpath to precede the filenames
This function is called by:

SOURCE CODE ^

0001 function dirpath = slmkdir(dirname, parentpath)
0002 %SLMKDIR Makes a directory if it does not exist
0003 %
0004 % $ Syntax $
0005 %   - dirpath = slmkdir(dirname)
0006 %   - dirpath = slmkdir(dirname, parentpath)
0007 %
0008 % $ Arguments $
0009 %   - dirname:      the name (relative path) of the diretory (r.t parent)
0010 %   - parentpath:   the path of the parent directory
0011 %   - dirpath:      the path of the created directory (r.t. '')
0012 %
0013 % $ Description $
0014 %   - dirpath = slmkdir(dirname) makes a diretory of given name if it
0015 %     does not exist.
0016 %
0017 %   - dirpath = slmkdir(dirname, parentpath) makes a diectory of given
0018 %     name if it does not exist, relative to parent path.
0019 %
0020 % $ History $
0021 %   - Created by Dahua Lin, on Aug 12nd, 2006
0022 %
0023 
0024 if isempty(dirname)
0025     return;
0026 end
0027 
0028 if nargin < 2 
0029     parentpath = '';
0030 end
0031 
0032 dirpath = sladdpath(dirname, parentpath);
0033 if ~exist(dirpath, 'dir')
0034     mkdir(dirpath);
0035 end
0036

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com