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
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
Mathematics For Machine Technology
8th Edition
ISBN:9781337798310
Author:Peterson, John.
Publisher:Peterson, John.
Chapter42: Algebraic Operations Of Division, Powers, And Roots
Section: Chapter Questions
Problem 119A
Related questions
Question
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
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
Step by step
Solved in 4 steps
Knowledge Booster
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
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell