How to increase decimals in matlab

Written by michael peter
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to increase decimals in matlab
Increasing the amount of numbers used after the decimal place increases calculation accuracy. (Hemera Technologies/ Images)

MATLAB is a technical computing software used in scientific and engineering fields for data processing and analysis. Data contained within one-dimensional arrays and two-dimensional matrices are input into m-files that contain complex algorithms, which allow for batch processing of different data sets. The accuracy, processing time and memory use depends on the precision of the numbers used for the data analysis process. Greater precision creates more accurate calculations since more numbers are used after the decimal place to describe the data. Less precision

rounds the number to four digits after the decimal, reducing the amount of numbers stored in memory. Deciding between the number precision depends on the accuracy of the calculations required, the amount mathematical processing steps and the tolerances used during data collection.

Skill level:
Moderately Easy

Other People Are Reading


  1. 1

    Clear all active variables within the workspace by entering "clear all" in the MATLAB Command window.

  2. 2

    Create a number that contains an infinite amount of numbers after the decimal. For example, enter "x=pi()" into the Command window. This command outputs "x=3.1416".

  3. 3

    Increase the number of decimal places output by MATLAB by entering "format long." The format long command takes the number to 15 decimal places. Inputting "x=pi()" now outputs "x=3.141592653589793".

  4. 4

    Enter "format short" followed by "x=pi()". The format short command takes the number to four decimal places. Therefore MATLAB outputs "x=3.1416".

Tips and warnings

  • The default setting for MATLAB is "format short." "Format long" must be typed into the Command window at the start of each new session. Once entered, the format remains until MATLAB is closed.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.