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 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 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 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 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 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 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 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 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 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 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)
- Command: PLOTTERMANAGER (from the autocad file m TO CONFIGURE A LOCAL, NONSYSTEM PLOTTER 10. PROFILES-Controls the use of profiles. A profile is a configuration you define. 367N 367N R=1.0m 426N 426N B. 426N C. The two identical sphemes having oqual weights of 367N is placed on top of the three identic al sphere's w/ 426 N as their reight . Compute the reaction A,B and Carrow_forward8. What are the main stages of the FEM? 9. Make a sketch of a linear triangular finite element. Point the nodes and write the approximating polynomial. 10. Describe with one sentence what the shape functions in FEM are. 11. Special case of which method is the method of Galerkin? 12. What are the three main parts of a FEM program? 13. How can be increased the accuracy of the derivatives for linear finite elements in FEM postprocessor? 14. Specify three methods for force computation in FEM postprocessor.arrow_forwardwrite one command for each case: take data name is 'x' and file name is 'database' Import data form Excel sheet to MATLAB. 1. Export data form MATLAB to Excel sheet. 2. Save data as text file. 3. Load data form text file. 4. Open and close file.arrow_forward
- Q4/ write one command for each case: take data name is 'x' and file name is 'database' Import data form Excel sheet to MATLAB. 1. Export data form MATLAB to Excel sheet. 2. Save data as text file. MATLAB 3. Load data form text file. 4. Open and close file.arrow_forward3. Convert C/C++ code to MIPS Code #include using namespace std; main () { int x, y, sum; x = 50; y = 60; %3D sum = x + y; cout << "Sum is: " « sum << endl; }arrow_forward3. As a robotic engineer, your boss needs you to move the gripper on the UGV to the target object. The workspace is shown Figure 1. In order to finish the task, you need to find the correct representation. {b} {c} {e} {s} {d} Figure 1 The Workspace The fixed frame is {s}, a body frame {b} is attached to the chassis of the UGV, a body frame {c} is attached to the gripper, a body frame {d} is attached to the sensor, and a body frame {e} is attached to the target object. The sensor's location is known as Tsd, the chassis of the UGV's location is known as Tsb, the gripper's location's is Tsc, and the target object's location is Tse. The sensor can detect the target object, so the target object can be represented in the sensor's frame. The configuration of the UGV is reported simultaneously, and the gripper's configuration is also known. How to represent the target object in the gripper's frame?arrow_forward
- (a) Summarize the following G and M code a. G41, G81, 691, G01, GOO b. M08, M30, M01, M06, M03 (b) Document three phases of writing a CNC program in the form of a block diagram. You don't have to write the actual CNC program.arrow_forwardI need the full code of MATLABarrow_forwardMake a matlab codearrow_forward
- 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