Matlab learning notes

Source: Internet
Author: User

Since MATLAB has been used for a long time, it was also a rookie. Recently, we have used MATLAB for a test and encountered various problems.

1: strings in MATLAB cannot be compared with =, but strcmp should be used.

= Is a comparison of one character and one character. If the character length is not equal, an error occurs, for example:

Therefore, to compare strings, use strcmp. If the string is the same, 1 is returned. If the string is different, 0 is returned.

 

2: simple operation

(1) concatenate strings into directories

Fullfile () is used, and the number of subsequent parameters is unlimited.


(2) load all files in a directory. Note that I starts from 3.

(3) concatenate two strings into one string

(4) structure initialization, access, and sorting


(5) the variables in Matlab are written to TXT.

<Method 1> Save 'acc.txt ''Acc'-ASCII, but the decimal point is very long (the format cannot be guaranteed). ACC is the variable name.

<Method 2>


Matlab learning notes

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.