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
Shown is a 10 by 10 grid, with coordinate axes x and y (Figure 1). The grid runs from -5 to 5 on both axes. Drawn on this grid are four vectors, labeled A through D. This problem will ask you various questions about these vectors. All answers should be in decimal notation, unless otherwise specified. Figure 1 of 1 Part A What is the x component of A? Express your answer to two significant figures. ▸ View Available Hint(s) AI Submit ΜΕ ΑΣΦ 5 -5 D C B A SIXP x axis -5 5 Part B What is the y component of A? Express your answer to the nearest integer. ΜΕ ΑΣΦ Ay = Submit Request Answer ? ?
please help
llo Tutors! Please help me to solve this problem and show the complete solution (including diagrams)Please don't answer it if you don't know the right answer/solution..And to those tutors who is just copying from chegg,shame on you?You didn't even know that those answer from chegg is incorrect..You just copy pasted it?Here is the problem,hope you will help me..Thanks❤️   2.) A two-lane highway with a design speed of 65 km/h crosses a single railroad track that serves trains traveling at 150 km/h. The highway serves a new development with a significant percentage of school-age children in the population necessitating the selection of a large school bus (68 passengers) as the design vehicle. If the crossing is controlled by a stop sign, determine(a) The minimum sight distance along the two-lane highway that will ensure all vehicles stopping at the stop line;(b) The minimum distance along the railroad track a bus driver should see that will allow him or her to cross the track safely after…
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
Text book image
Residential Construction Academy: House Wiring (M...
Civil Engineering
ISBN:9781285852225
Author:Gregory W Fletcher
Publisher:Cengage Learning