ENGINEERING FUNDAMENTALS
ENGINEERING FUNDAMENTALS
6th Edition
ISBN: 9781337705011
Author: MOAVENI
Publisher: CENGAGE L
bartleby

Concept explainers

Question
Book Icon
Chapter 15, Problem 1P

(a)

To determine

Using the MATLAB Help menu discuss how the function ABS(X) used.

(a)

Expert Solution
Check Mark

Explanation of Solution

In MATLAB, go to Help, it shows the documentation, examples, wed support, and academy symbols. Open the documentation then search for the specific functions, it will provides the syntax function then click on it, will shows the information about each of the function.

Search for the function ABS(X), the function ABS(X) is used to display the absolute value of the real values and complex values.

Example 1:

In the MATLAB command window type the code as follows,

X=-5;

abs(X)

The output will be displayed as follows,

ans =

     5

Example 2:

In the MATLAB command window type the code as follows,

X=-5+6*i;

abs(X)

The output will be displayed as follows,

ans =

    7.8102

Conclusion:

Thus, the function ABS(X) has been explained.

(b)

To determine

Using the MATLAB Help menu discuss how the function TIC, TOC used.

(b)

Expert Solution
Check Mark

Explanation of Solution

Now Search for the command, it is TIC is used to start a stopwatch timer and the command TOC is used to print the number of seconds required for the operation. Both are used to find the program elapsed time.

Example:

In the MATLAB command window write the code as follows,

tic

P = rand(1000,300);

Q = rand(1000,300);

toc

C = P'.*Q';

toc

Its output displays as below, but it is changes every time as the execution time elapsed different time length for each execution,

Elapsed time is 0.049194 seconds.

Elapsed time is 0.067125 seconds.

Conclusion:

Thus, the function TIC, TOC has been explained.

(c)

To determine

Using the MATLAB Help menu discuss how the function SIZE(x) used.

(c)

Expert Solution
Check Mark

Explanation of Solution

Now search for the SIZE (x), it is the two vector function which determines the number of rows and columns in the M by N matrix.

Example:

Consider the matrix as follows:

x=[123456789]

In the MATLAB command window write the code as follows,

x=[1 2 3;4 5 6;7 8 9];

D=size(x)

The output will be displayed as follows,

D =

     3     3

Conclusion:

Thus, the function SIZE(x) has been explained.

(d)

To determine

Using the MATLAB Help menu discuss how the function FIX(x) used.

(d)

Expert Solution
Check Mark

Explanation of Solution

Now search for the command FIX(x) in Help tab, it is used to round the element of x to the nearest integer towards zero.

Example:

In the MATLAB command window write the code as follows,

x=3.48;

fix(x)

The output will be displayed as follows:

ans =

     3

Conclusion:

Thus, the function FIX(x) has been explained.

(e)

To determine

Using the MATLAB Help menu discuss how the function FLOOR(x) used.

(e)

Expert Solution
Check Mark

Explanation of Solution

The command FLOOR(x) is used to round the element of x to the nearest integer towards negative infinity.

Example:

In the MATLAB command window write the code as follows,

x=-3.67;

floor(x)

The output will be displayed as follows,

ans =

    -4

Conclusion:

Thus, the function FLOOR(x) has been explained.

(f)

To determine

Using the MATLAB Help menu discuss how the function CEIL(x) used.

(f)

Expert Solution
Check Mark

Explanation of Solution

In MATLAB Help tab search the function, the command CEIL(x) is used to round the element of x to the nearest integer towards infinity.

Example:

In the MATLAB command window write the code as follows,

x=3.67;

ceil(x)

The output will be displayed as follows,

ans =

     4

Conclusion:

Thus, the function CEIL(x) has been explained.

(g)

To determine

Using the MATLAB Help menu discuss how the function CALENDAR used.

(g)

Expert Solution
Check Mark

Explanation of Solution

The CALENDAR function is a 6×7 matrix used to display the calendar for a specified or current month. The first column ‘S’ of the matrix is corresponds to Sunday. It is also expressed as CALENDAR(DATE) by default displays January month date, CALENDAR(Year, Month) and CALENDAR(Month, date).

Example 1:

In the MATLAB command window write the code as follows,

calendar (1989,10)

The output will be displayed as follows,

                   Oct 1989

     S     M    Tu     W    Th     F     S

     1     2     3     4     5     6     7

     8     9    10    11    12    13    14

    15    16    17    18    19    20    21

    22    23    24    25    26    27    28

    29    30    31     0     0     0     0

     0     0     0     0     0     0     0

Example 2:

In the MATLAB command window write the code as follows,

calendar (8,10)

The output will be displayed as follows,

                    Oct 0008

     S     M    Tu     W    Th     F     S

     0     0     0     1     2     3     4

     5     6     7     8     9    10    11

    12    13    14    15    16    17    18

    19    20    21    22    23    24    25

    26    27    28    29    30    31     0

     0     0     0     0     0     0     0

Conclusion:

Thus, the function CALENDAR has been explained.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Please include the figured and please write the true answer. Please make sure that it is 2 decimal points in every answer. Please double check your calculations and please put the formula that had been used and the explanation
Calculate so that efforts are balanced. Follow the figure below. Hint: Use concepts of Solid Mechanics.
A person by the name of Huebscher developed a relationship between theequivalent size of round ducts and rectangular ducts according toĀ  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  D = diameter of equivalent circular duct (mm)a = dimension of one side of the rectangular duct (mm)b = the other dimension of the rectangular duct (mm)Using Excel, create a table that shows the relationship between the circular and the rectangular duct dimensions, similar to the one shown in the accompanying table.
Knowledge Booster
Background pattern image
Civil Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, civil-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Engineering Fundamentals: An Introduction to Engi...
Civil Engineering
ISBN:9781305084766
Author:Saeed Moaveni
Publisher:Cengage Learning