Lesson two moving data movement
Common built-in functions
(1) Loading Files
Load file name. dat ( or load (' file name. Dat '))
Then enter the filename to see the data in the file
(2) displays all variables for the current workspace Who/whos(more details)
(3) clears the variable clear variable name
Directly entering clear will delete all variables in the current workspace
(4) size of matrix (a)/Length (a)
size (A) The return value is still a matrix [r,v] (Size (a,1) returns the number of rows in a matrix size (a,2) returns a matrix of columns)
Length (A) returns the maximum number of rows and columns, often used in vectors
(5) flips the given matrix flipud (A)
(6) Max ( row of multiple columns) returns the maximum element value in the matrix
( multiple rows and columns) returns the largest column of an element in a matrix
Max (a,[],2) outputs the largest column in matrix A as a matrix (arranged in close proximity to the 2nd element, near the front)
Max(:) outputs all elements of matrix A in vector form
(7) Change the number of digits in a valid numeric display ( default is short) format (OPT)/format opt (8) Modify command line PS1 (opt) prompt
(9) shows the usage of the built-in function func help func(arbitrary)
(10) Print disp(sprintf (' 6 decimals:%0.6f ', a)) PS: print and display the variable A in the console six digits after the decimal point.
(11) displays the path where the current file is located pwd
(12) go to file CD
(13) list all files in the current directory LS
(14) store data (in binary form) The 1th to ten data in a file in v = file name (1:10)
Store v in hello.dat file save Hello.dat v
( in the form we can understand) the ASCII code of V into the hello.txt file Save hello.txt v-ascii
Octave Tutorial ("Machine learning") second lesson "Data movement"