Matlab Initial value step end:: x=a:b:c What does it mean?

Source: Internet
Author: User

Example 1Calculate int (sin (x), 0,PI)
  
 
    1. %by Dynamic
    2. %all rights reserved by www.matlabsky.com
    3. > >x=0:pi/100:2*pi;
    4. >>y=sin (x);
    5. >>z=trapz (x, y)% or use z = Pi/100*trapz (y)
    6. z =
    7. Li style= "margin:0px 0px 0px 30px; padding:0px; border:0px; List-style:decimal ">     1.0300e-017
    8. >>z = Pi/100*trapz (y)
X=a:b:c refers to an array starting with a, step B, and a final value of C. Like R=1:3:9; r=[1 4 7]
R=1:3:9 and R=1:3:8 are equal.
1 is the starting value, 3 is the step, add to 7 time plus 3 is 10, than 8 or 9 is large, so r=1:3:9 and R=1:3:8 get the sequence is to 7 end

Matlab Initial value step end:: x=a:b:c What does it mean?

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.