please write a mathlab code that shows the value of 26* pi in 6 different formats.  show the result of 26*π in the Short format

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
icon
Related questions
Question

please write a mathlab code that shows the value of 26* pi in 6 different formats. 

  1. show the result of 26*π in the Short format
Expert Solution
Step 1

Some of the numeric output format options:

No. Style Description Example
1 short (default) short and fixed with 4 digits after decimal point 3.1416
2 long long and fixed with 15 digits after the decimal point for double values and 7 digits after the decimal for single values 3.141592653589793
3 shortE short scientific notation (having e) with 4 digits after decimal point 3.1416e+00
4 longE long scientific notation (having e) with 15 digits after the decimal point for double values and 7 digits after the decimal for single values 3.141592653589793e+00
5 shortEng short engineering notation in which exponent is a multiple of 3 and has 4 digits after the decimal point 3.1416e+000
6 longEng short engineering notation in which exponent is a multiple of 3 and has 15 significant digits after the decimal point 3.141592653589793e+000

 

Apart from the above mentioned, there are other formats like:

1. shortG

2. longG

3. +

4. bank

5. hex

6. rat

Step 2

The aim is to code a Mathlab program that shows the value of 26* pi in 6 different formats. 

The syntax for format is:

format <format type>

To identify the formats easily, assign the values to some variables after formatting.

The Mathlab code is as follows:

 

format short
short_value=26*pi

format long
long_value=26*pi

format shortE
shortE_value=26*pi

format longE
longE_value=26*pi

format shortEng
shortEng_value=26*pi

format longEng
longEng_value=26*pi

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Interpolation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, advanced-math and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,