Octave Tutorial ("Machine learning") second lesson "Data movement"

Source: Internet
Author: User


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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.