File And Workspace Management In Matlab
Commands
in MATLAB can be ENTER interactively in the command window or save them in an
M-File. So it's important to know some commands in file management. The table
below shows some commands and their uses for file management in MATLAB.
Command
|
Usability
|
dir, ls
|
Display files in the active directory
|
delete
filename
|
Remove file names
|
cd, pwd
|
Displays active directory
|
cd dir, chdir
|
Change directory
|
type
filename
|
Display the contents of the file name
|
what
|
Display .m and .mat files that are in active
directory
|
The commands in the table below help users in managing workspaces in MATLAB.
Command
|
Usability
|
who
|
Display all variables in the workspace
|
whos
|
Displays all variables in the workspace along
with the size of bytes, array dimensions and object types
|
clear
|
Remove all variables from the workspace
|
Clear
x y
|
Remove the x and y variables from the
workspace
|
Being able to get data in MATLAB and save it is very important. Following are some ways to get data from inside and outside MATLAB.
1. In
the Command Window: the following is how to use the save and load command.
Command
|
Usability
|
save
filename
|
Save all commands in filename.mat
|
save
filename var1 var2
|
Saving only var1 and var2 variables in filename.mat
|
save
filename var1 -ascii
|
Save the var1 variable in ASCII format on the
filename
|
2. There are commands for saving and loading workspaces. For saving: there is a Save Workspace menu button while for Loading there is an Open menu button.
3.
Import: in Matlab, there is a window like spreadsheet for inputting data in
facilitating importing a data set.
SUBSCRIBE TO OUR NEWSLETTER
0 Response to "File And Workspace Management In Matlab"
Post a Comment