Concept explainers
(a)
Using the MATLAB Help menu discuss how the function ABS(X) used.
(a)
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)
Using the MATLAB Help menu discuss how the function TIC, TOC used.
(b)
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)
Using the MATLAB Help menu discuss how the function SIZE(x) used.
(c)
Explanation of Solution
Now search for the SIZE (x), it is the two
Example:
Consider the matrix as follows:
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)
Using the MATLAB Help menu discuss how the function FIX(x) used.
(d)
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)
Using the MATLAB Help menu discuss how the function FLOOR(x) used.
(e)
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)
Using the MATLAB Help menu discuss how the function CEIL(x) used.
(f)
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)
Using the MATLAB Help menu discuss how the function CALENDAR used.
(g)
Explanation of Solution
The CALENDAR function is a
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?
Chapter 15 Solutions
ENGINEERING FUNDAMENTALS
- Present Example 9.4 in Chapter 9 using the format discussed in Section 4.2. Divide the example problem into Given, Find, and Solution sections.arrow_forward* MATLAB command clear x y is used for Remove all variables O Remove the variable x and y Oarrow_forwardThe domain and range of the * :function which has the graph %23 is x 2 1 & y > 1 O is x 2 2 & y > 2 O is x 1 O is x 2 2 & y > 1 O is x 2 2 & y 1 O is x > 1 & y > 1 Oarrow_forward
- Find the D10,D30 & D60 from the given graph,where the blue line represents the cumulative distribution while X-axis dimensions are in logarithmic scale.arrow_forwardProgramming the MCS Method in MATLAB or any programming language which you are familiar according to the procedure proposed by this course.arrow_forwardPlease answer correctly, PLEASE! Thank you I will ?arrow_forward
- Engineering Fundamentals: An Introduction to Engi...Civil EngineeringISBN:9781305084766Author:Saeed MoaveniPublisher:Cengage LearningResidential Construction Academy: House Wiring (M...Civil EngineeringISBN:9781285852225Author:Gregory W FletcherPublisher:Cengage Learning