
Try to see what this script does. After executing the script, figure out what is
the difference between the command
d
d
i
i
s
s
p
p and the
f
f
p
p
r
r
i
i
n
n
t
t
f
f. Use the command
w
w
h
h
o
o to view the script’s variables that are saved in the workspace. Notice
that a script does not has the same structure as a function. Moreover,
observe on Figure 13 that on the bottom of the Editor/Debugger there is a
predefined caption area that indicates that the current m-file is a script.
Important Note: when you start writing scripts and functions that are
stored in a certain directory, you occasional need to see what files are
included in this directory. To do so, from the command window you can use
the
d
d
i
i
r
r command (the same one as used in the MS-DOS) to view the
contents of Matlab’s current directory or
w
w
h
h
a
a
t
t to view all m-files in the
directory. Additionally, you can use
c
c
d
d directory_name to set the current
directory to the one specified and
c
c
d
d .. to move to the directory above the
current one. Moreover,
d
d
e
e
l
l
e
e
t
t
e
e file_name deletes the specified file, and
p
p
w
w
d
d
prints on the screen the current directory.
Komentáře k této Příručce