Page 23 - MATLAB Recipes for Earth Sciences
P. 23

14                                            2 Introduction to MATLAB

            after the prompt on a Windows system and
               cd /users/username

            or
               cd /home/username

            if you are username on a UNIX or LINUX system. There you should create
            a personal working directory by typing

               mkdir mywork

            The software uses a search  path to find MATLAB-related files, which are

            organized in directories on the hard disk. The default search path only in-
            cludes the MATLAB directory that has been created by the installer in the
            applications folder. To see which directories are in the search path or to add
            new directories, select Set Path from the File menu, and use the Set Path
            dialog box. Alternatively, the command
               path
            prints the complete list of directories included in the search path. We attach
            our personal working directory to this list by typing

               path(path,’c:\Documents and Settings\user\My Documents\MyWork’)
            on a Windows machine assuming that you are  user, you are working on
            Hard Disk C and your personal working directory is named MyWork. On a
            UNIX or LINUX computer the command

               path(path,'/users/username/work')
            is used instead. This command can be used whenever more working direc-
            tories or toolboxes have to be added to the search path. Finally, you can
            change into the new directory by typing

               cd mywork
            making it the current working directory. The command

               what

            lists all MATLAB-related files contained in this directory. The modifi ed
            search path is saved in a fi le  pathdef.m in your home directory. In a future

            session, the software reads the contents of this file and makes MATLAB to
            use your custom path list.
   18   19   20   21   22   23   24   25   26   27   28