![Thinking Like an Engineer: An Active Learning Approach (3rd Edition)](https://www.bartleby.com/isbn_cover_images/9780133593211/9780133593211_largeCoverImage.gif)
Concept explainers
Which of the following are not valid program/function file names? Circle all that apply.
- A. 2b_solved.m
- B. calc_circuit.m
- C. graph_data.m
- D. help4me.m
- E. MATLAB is fun.m
- F. matrix*matrix.m
- G. Mult2#s.m
- H. pi.m
- I. ReadFile.m
- J. superCaliFragiListicExpiAliDocious.m
A.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name 2b_solved.m is invalid.
Explanation of Solution
Rules for naming MATLAB program/function.
- 1. Name of MATLAB function must start with a letter (alphabet).
- 2. The initial letter must be followed by letters, numbers or underscore.
- 3. The name of MATLAB function must not resemble any reserved words in MATLAB.
The given name 2b_solved.m is started with a number not with a letter. Therefore, the given function name is invalid.
Conclusion:
Therefore, the function name 2b_solved.m is invalid.
B.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name calc_circum.m is valid.
Explanation of Solution
The given function name calc_circum.m meets all the criteria of rules that have to be followed for proper function name. Therefore, the given function name is valid.
Conclusion:
Therefore, the function name calc_circum.m is valid.
C.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name graph-data.m is invalid.
Explanation of Solution
Rules for naming MATLAB program/function.
- 1. Name of MATLAB function must start with a letter (alphabet).
- 2. The initial letter must be followed by letters, numbers or underscore.
- 3. The name of MATLAB function must not resemble any reserved words in MATLAB.
The given function name graph-data.m contains hyphen (which is not allowed) not an underscore. Hence, the given function name is invalid.
Conclusion:
Therefore, the function name graph-data.m is invalid.
D.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name help4me.m is valid.
Explanation of Solution
The given function name help4me.m meets all the criteria of rules that have to be followed for proper function name. Therefore, the given function name is valid.
Conclusion:
Therefore, the function name help4me.m is valid.
E.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name MATLAB is fun.m is invalid.
Explanation of Solution
Rules for naming MATLAB program/function.
- 1. Name of MATLAB function must start with a letter (alphabet).
- 2. The initial letter must be followed by letters, numbers or underscore.
- 3. The name of MATLAB function must not resemble any reserved words in MATLAB.
The given function name MATLAB is fun.m contain spacing between the words, which is not allowed. Hence, the given function name is invalid.
Conclusion:
Therefore, the function name MATLAB is fun.m is invalid.
F.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name matrix*matrix.m is invalid.
Explanation of Solution
Rules for naming MATLAB program/function.
- 1. Name of MATLAB function must start with a letter (alphabet).
- 2. The initial letter must be followed by letters, numbers or underscore.
- 3. The name of MATLAB function must not resemble any reserved words in MATLAB.
- 4. The name of MATLAB function should not contain any special characters like *, #, $ etc. and spacing between the words.
The given function name matrix*matrix.m contains a special character “*” which is not allowed. Hence, the given function name is invalid.
Conclusion:
Therefore, the function name matrix*matrix.m is invalid.
G.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name Mult2#s.m is invalid.
Explanation of Solution
Rules for naming MATLAB program/function.
- 1. Name of MATLAB function must start with a letter (alphabet).
- 2. The initial letter must be followed by letters, numbers or underscore.
- 3. The name of MATLAB function must not resemble any reserved words in MATLAB.
- 4. The name of MATLAB function should not contain any special characters like *, #, $ etc. and spacing between the words.
The given function name Mult2#s.m contains a special character “#” which is not allowed. Hence, the given function name is invalid.
Conclusion:
Therefore, the function name Mult2#s.m is invalid.
H.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name pi.m is invalid.
Explanation of Solution
The given function name pi.m meets all the criteria of rules that have to be followed for proper function name. Even though pi.m meets all the criteria, it’s a built-in MATLAB function, which provides the standard value as 3.14. So, it is necessary to avoid the file names, which are same as the name of standard built-in functions.
Conclusion:
Therefore, the function name pi.m is invalid.
I.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name ReadFile.m is valid.
Explanation of Solution
The given function name ReadFile.m meets all the criteria of rules that have to be followed for proper function name. Therefore, the given function name is valid.
Conclusion:
Therefore, the function name ReadFile.m is valid.
J.
![Check Mark](/static/check-mark.png)
Check whether the given function name or program is valid or invalid.
Answer to Problem 1ICA
The function name SuperCaliFragiListicExpiAliDocious.m is valid.
Explanation of Solution
The given function name SuperCaliFragiListicExpiAliDocious.m meets all the criteria of rules that have to be followed for proper function name. Therefore, the given function name is valid.
Conclusion:
Therefore, the function name SuperCaliFragiListicExpiAliDocious.m is valid.
Want to see more full solutions like this?
Chapter 17 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
- A particle is held and then let go at the edge of a circular shaped hill of radius R = shown below. The angular motion of the particle is governed by the following ODE: + 0.4 02 - 2 cos 0 + 0.8 sin 0 = 0 where is the angle in rad measured from the top (CCW: +), ė 5m, as = wis the velocity in rad/s, ==a is the angular acceleration in rad/s². Use MATLAB to numerically integrate the second order ODE and predict the motion of the particle. (a) Plot and w vs. time (b) How long does it take for the particle to fall off the ring at the bottom? (c) What is the particle speed at the bottom. Hint v = Rw. in de all questions the particles inside the tube. /2/07/25 Particle R 0 0 R eled witharrow_forwardIf FA = 40 KN and FB = 35 kN, determine the magnitude of the resultant force and specify the location of its point of application (x, y) on the slab. 30 kN 0.75 m 90 kN FB 2.5 m 20 kN 2.5 m 0.75 m FA 0.75 m 3 m 3 m 0.75 marrow_forwardThe elastic bar from Problem 1 spins with angular velocity ω about an axis, as shown in the figure below. The radial acceleration at a generic point x along the bar is a(x) = ω 2 x. Under this radial acceleration, the bar stretches along x with displacement function u(x). The displacement u(x) is governed by the following equations: ( d dx (σ(x)) + ρa(x) = 0 PDE σ(x) = E du dx Hooke’s law (2) where σ(x) is the axial stress in the rod, ρ is the mass density, and E is the (constant) Young’s modulus. The bar is pinned on the rotation axis at x = 0 and it is also pinned at x = L. Determine:1. Appropriate BCs for this physical problem.2. The displacement function u(x).3. The stress function σ(x).arrow_forward
- The heated rod from Problem 3 is subject to a volumetric heatingh(x) = h0xLin units of [Wm−3], as shown in the figure below. Under theheat supply the temperature of the rod changes along x with thetemperature function T(x). The temperature T(x) is governed by thefollowing equations:(−ddx (q(x)) + h(x) = 0 PDEq(x) = −kdTdx Fourier’s law of heat conduction(4)where q(x) is the heat flux through the rod and k is the (constant)thermal conductivity. Both ends of the bar are in contact with a heatreservoir at zero temperature. Determine:1. Appropriate BCs for this physical problem.2. The temperature function T(x).3. The heat flux function q(x).arrow_forwardA heated rod of length L is subject to a volumetric heating h(x) = h0xLinunits of [Wm−3], as shown in the figure below. Under the heat supply thetemperature of the rod changes along x with the temperature functionT(x). The temperature T(x) is governed by the following equations:(−ddx (q(x)) + h(x) = 0 PDEq(x) = −kdTdx Fourier’s law of heat conduction(3)where q(x) is the heat flux through the rod and k is the (constant)thermal conductivity. The left end of the bar is in contact with a heatreservoir at zero temperature, while the right end of the bar is thermallyinsulated. Determine:1. Appropriate BCs for this physical problem.2. The temperature function T(x).3. The heat flux function q(x).arrow_forwardCalculate the mean piston speed (in mph) for a Formula 1 engine running at 14,750 rpm with a bore of 80mm and a stroke of 53mm. Estimate the average acceleration imparted on the piston as it moves from TDC to 90 degrees ATDCarrow_forward
- Calculate the compression ratio of an engine with a stroke of 4.2inches a bore of 4.5 inches and a clearance volume of 6.15 cubic inches. Discuss whether or not this is a realistic compression ratio for a street engine and what octane rating of fuel it would need to run correctlyarrow_forwardDraw the free-body diagram for the pinned assembly shown. Find the magnitude of the forces acting on each member of the assembly. 1500 N 1500 N C 45° 45° 45° 45° 1000 mmarrow_forwardAn elastic bar of length L spins with angular velocity ω about an axis, as shown in the figure below. The radial acceleration at a generic point x along the bar is a(x) = ω 2 x. Due to this radial acceleration, the bar stretches along x with displacement function u(x). The displacement u(x) is governed by the following equations: ( d dx (σ(x)) + ρa(x) = 0 PDE σ(x) = E du dx Hooke’s law (1) where σ(x) is the axial stress in the rod, ρ is the mass density, and E is the (constant) Young’s modulus. The bar is pinned on the rotation axis at x = 0, and it is free at x = L. Determine:1. Appropriate BCs for this physical problem.2. The displacement function u(x).3. The stress function σ(x).arrow_forward
- With reference to the given figure: a) Draw a free-body diagram of the structure supporting the pulley. b) Draw shear and bending moment diagrams for both the vertical and horizontal portions of the structure. 48 in. 100 lb 12 in. Cable 27 in. 12-in. pulley radius 100 lb Cablearrow_forwardConsider a standard piston engine . Draw a free body diagram of the piston. Then:a) For an A SI engine with a 100 mm bore at an instantaneous cylinder pressure of 42 bar i. Calculate the level of the combustion gas loading force on the wrist pin in kN. b) Repeat this calculationfor a forced-induction Diesel engine with a 145 mm boreat a cylinder pressure of 115 bararrow_forwardA punch press with flywheel adequate to minimize speed fluctuation produces 120 punching strokes per minute, each providing an average force of 2000 N over a stroke of 50 mm. The press is driven through a gear reducer by a shaft rotating 200 rpm. Overall efficiency is 80%. a) What power (W) is transmitted through the shaft? b) What average torque is applied to the shaft?arrow_forward
- Refrigeration and Air Conditioning Technology (Mi...Mechanical EngineeringISBN:9781305578296Author:John Tomczyk, Eugene Silberstein, Bill Whitman, Bill JohnsonPublisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9781305578296/9781305578296_smallCoverImage.gif)