2.7: Scientific Notation for Large and Small Numbers

Matlab and Octave Programming for STEM Applications · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    2.7: Scientific Notation for Large and Small Numbers

      It is common in the USA to enter numbers >= 1000 using commas. However, commas are not used that way in MATLAB and Octave. As you will read in the chapter on vectors, commas are used to separate elements of a vector. One way to enter large numbers is to simply leave out the commas, as shown in these examples:

      a = 1000

      b = 54321

      If you enter b with a comma:

      b = 54,321

      the result is is 2 separate numbers:

      b =    54
      ans =   321

      That is not what is intended.

      According to the World Bank, the 2023 population of Brazil is 215,313,498

      (World Bank, Brazil Population)

      In MATLAB or Octave, this can be entered as:

      Brazil_population= 215313498

      Alternatively this can be entered using scientific notation (also called exponent notation):

      Brazil_population= 215.313498E6 % The "E" indicates 

      The speed of light in vacuum can be written (approximately) as

      c = 3.0E8 % m/s 

      The "E" can be either upper or lower case:

      c = 3.0e8 % m/s

      Similar notation can be used for very small numbers. For example the wavelength of a red LED might be 650 nm

      red_wavelength = 650e-6 % meters

       


      This page titled 2.7: Scientific Notation for Large and Small Numbers was last modified on Fri, 15 Sep 2023 23:44:23 GMT and is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Carey Smith.