1. Some operations on the command line environment:
(1) clc clears a page of command window, And the cursor goes back to the upper left corner of the screen
(2) clear all variables from the Workspace
(3) clf clears the image window content
(4) who lists the variables in the current Workspace
(5) whos lists the variables and information in the current workspace.
Or use the Workspace browser on the toolbar.
(6) delete <File Name> delete a specified file from the disk
(7) which <File Name> searches for the path of the specified file
(9) clear all variables and functions from the Workspace
(10) help <command name> query the help information of the listed commands
(11) save name: save the workspace variable to the file name. mat.
(12) save name x y save workspace variable x y to file name. mat
(13) load name: Download all variables in the 'name' file to the workspace.
(14) load name x y: Download the variable x y in the 'name' file to the workspace.
(15) diary name1.m saves a piece of text in the workspace to the name1.m File
... Diary off
(16) view the name. m file in the workspace.
(17) what lists the m Files And mat files in the current directory
Ctrl + p call the last command
Ctrl + n call the next command line
Ctrl + B move back
→ Ctrl + f move one cell forward
Ctrl + ← Ctrl + r move a word to the right
Ctrl + → Ctrl + l move a word to the left
Home Ctrl + a move the cursor to the beginning of the line
End Ctrl + e move the cursor to the End of the row
Esc Ctrl + u clear a row
Del Ctrl + d clear the character behind the cursor
Backspace Ctrl + h clear the cursor prefix
Ctrl + k clear the cursor to the end of the line
Ctrl + c interrupt program running
I. Common window commands
Help start online help file display
What is used to list related files in the current directory?
Type list M Files
Lookfor keyword search in help information
Which: Find the Directory Name of the function and file
Demo run the demo program of MATLAB
Set or query the MATLAB path
Ii. statements related to files and operations
Cd changes the current working directory
Dir: list the contents of the current directory
Delete File
Getenv
Unix executes the operating system command and returns the result
Diary saves the commands run by MATLAB
Fopen Open File
Fclose close file
Fread reads binary data from a file
Fwrite writes binary data to a file
Fscanf reads formatted data from a file
Fprintf writes formatted data to a file
Fgetl reads the row from the file and discards the line break.
Fgets reads rows from the file and keeps the line break
Error message of input and output of the ferror Query file
Feof checks the end mark of a file
Fseek sets the file location pointer
Ftell obtains the position of the file location pointer.
Prewind bypasses an opened file
Create a temporary file name for tempname
Tempdir returns an existing temporary directory name.
Iii. startup and Exit commands
Quit, exit from the MATLAB environment
Startup MATLAB self-starting File
Start main program
4. Variable workspace management commands
Who briefly lists the workspace variable names
Whos list the variables in the workspace in detail
Load reads variables from files
Save to list the variables stored in a workspace
Clear deletes variables and functions in the memory.
Pack the memory of the Workspace
Size: the dimension of the query matrix.
Disp display matrix and text
Length query vector dimension
5. Common commands for command window control
Cedit sets command line editing and callback Parameters
Clear the display in the clc command window
Home move the cursor to the upper left corner
Format: Set the output format
Echo: MATLAB command in the display file
More control command window output page