Concept explainers
a)
Use the lookfor command to find the MATLAB commands that deal with “sine”.
Answer to Problem C.1E
Using lookfor command we can find the MATLAB command which deals with sine.
Explanation of Solution
Given:
Look for command.
Calculation:
Syntax.
Y = sind(x)
Here we can describe the syntax as.
Y = sind(x) which gives the sine of the elements in x, which are shown in degree.
for calculating sind(180) SOLUTION will be zero because 180 degree compare to sine of pi radian.
So, value of sin(pi) = 1.2246e-16.
Conclusion:
Lookfor command use for finding matlab functions.
b)
Use the lookfor command to find the MATLAB commands that deal with “plot”.
Answer to Problem C.1E
Using lookfor command we can find the MATLAB command which deals with plot.
Explanation of Solution
Given:
Lookfor command.
Calculation:
By using plot function in matlab command, can be plot the graph by performing following steps.
1. define x, by deciding the range of value for the variable x, for that function is to be plotted.
2. define the function, y = f(x)
3. call the plot command as plot(x, y)
For example, plotting simple function y = x, and the range of values for x from 0 to 100, with an increment of 5.
Code will be x = [0:5:100];
y = x;
plot (x, y)
when you execute the file, MATLAB displays the below plot as:
Conclusion:
Lookfor command use for finding matlab functions.
c)
Use the lookfor command to find the MATLAB commands that deal with “logarithm”.
Answer to Problem C.1E
Using lookfor command we can find the MATLAB command which deals with logarithm.
Explanation of Solution
Given:
Lookfor command.
Calculation:
LOG function in MATLAB whose base is 10 logarithm and it is calculated as log10.
It is natural logarithm.
lookfor logarithm.
the result shown below:
LOGSPACE logarithm spaced
LOG Natural logarithm.
LOG10 common base10 logarithm.
LOG2 Base2 logarithm and dissect floating point number,
BETALN Logarithm of beta function,
GAMMALN logarithm of gamma function.
LOGM Matrix logarithm.
Conclusion:
Lookfor command use for finding matlab functions.
d)
Use the lookfor command to find the MATLAB commands that deal with “variable”.
Answer to Problem C.1E
Using lookfor command we can find the MATLAB command which deals with variable.
Explanation of Solution
Given:
Lookfor command.
Calculation:
In MATLAB environment, every variable is an array or matrix.
We can assign variables as x = 3; defining x and starting with a value.
x = 3.
It creates a 1 by 1 matrix named x and stores the value in its element.
Let us have example, x = sqrt(16);
Conclusion:
Lookfor command use for finding matlab functions.
f)
Use the lookfor command to find the MATLAB commands that deal with “path”.
Answer to Problem C.1E
Using lookfor command we can find the MATLAB command which deals with path.
Explanation of Solution
Given:
Lookfor command.
Calculation:
It is must ensure before loading file in MATLAB that it can find the files. Initially MATLAB look in current directory after that it find paths which is previously saved.
To explore the path available in MATLAB type “path” at MATLAB prompt. MATLAB would search files that we want or follow by the list of the directories.
Conclusion:
Lookfor command use for finding matlab functions.
g)
Use the lookfor command to find the MATLAB commands that deal with “exponential”.
Answer to Problem C.1E
Using lookfor command we can find the MATLAB command which deals with exponential.
Explanation of Solution
Given:
Lookfor command.
Calculation:
Syntax a = exp(b)
If a = exp(b) will return exponential ex for each element in array b.
For complex elements
It resulted
Conclusion:
Lookfor command use for finding matlab functions.
Want to see more full solutions like this?
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY