
Concept explainers
Answer the question with each of the following code segments. If an error will occur, write ERROR and explain what caused the error.
a. What is stored in Count by the following code?
b. What is displayed on the screen by the following code?
c. What is displayed on the screen by the following code?
d. What is stored in P and C after the following code executes?
a.

What variable is stored in Count.
Answer to Problem 1ICA
The variable stored in Count is 8.
Explanation of Solution
Given data:
Count =0;
for N=10:-0.2:8.5;
Count=Count+1;
end
Program execution:
Steps to execute the MATLAB program:
- 1. Open the command window and paste the given program.
- 2. Press enter.
- 3. Output is displayed in command window.
Enter Count in the command window and execute the program.
>> Count
Count =
8
Conclusion:
Thus, the variable stored in Count is 8.
b.

What is displayed on the screen after executing the given program.
Answer to Problem 1ICA
The output displayed on the screen:
6
12
20
30
42
56
Explanation of Solution
Given data:
for m=3:8
fprintf('%0.0f\n',m^2-m)
end
Program execution:
Steps to execute the MATLAB program:
- 1. Open the command window and paste the given program.
- 2. Press enter.
- 3. Output is displayed in command window.
MATLAB Output after execution of program is displayed as follows.
6
12
20
30
42
56
Conclusion:
Thus, the Output displayed on the screen:
6
12
20
30
42
56
c.

What is displayed on the screen after executing the given program.
Answer to Problem 1ICA
The output displayed in the screen is 56.
Explanation of Solution
Given data:
for m=3:8;
M2=m^2-m;
end
fprintf('%0.0f\n',M2)
Program execution:
Steps to execute the MATLAB program:
- 1. Open the command window and paste the given program.
- 2. Press enter.
- 3. Output is displayed in command window.
MATLAB Output after execution of program is displayed as follows.
56
Conclusion:
Thus, the output displayed in the screen is 56.
d.

What variables are stored in p and C.
Answer to Problem 1ICA
The variables stored in in p and C are p=945 and C=4.
Explanation of Solution
Given data:
S=3;
I=2;
P=1;
C=0;
for K=S:I:S^I
P=P*K;
C=C+1;
end
Program execution:
Steps to execute the MATLAB program:
- 1. Open the command window and paste the given program.
- 2. Press enter.
- 3. Output is displayed in command window.
Enter P and C in the command window and execute the program.
>> P
P =
945
>> C
C =
4
Conclusion:
Thus, the variables stored in in p and C are p=945 and C=4.
Want to see more full solutions like this?
Chapter 20 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
- Please do not use any AI tools to solve this question. I need a fully manual, step-by-step solution with clear explanations, as if it were done by a human tutor. No AI-generated responses, please.arrow_forwardPlease do not use any AI tools to solve this question. I need a fully manual, step-by-step solution with clear explanations, as if it were done by a human tutor. No AI-generated responses, please.arrow_forwardCE-112 please solve this problem step by step and give me the correct answerarrow_forward
- CE-112 please solve this problem step by step and give me the correct asnwerarrow_forwardthis is an old practice exam, the answer is Ax = -4, Ay = -12,Az = 32.5, Bx= 34, Bz = 5, By = 0 but how?arrow_forwardThis is an old practice exam, the answer is Ax = Az = 0, Ay = 2000, TDE = 4750, Cx = 2000, Cy = 2000, Cz = -800 but how?arrow_forward
- this is an old practice exam, the answer is Fmin = 290.5lb but howarrow_forwardThis is an exam review question. The answer is Pmin = 622.9 lb but whyarrow_forwardPlease do not use any AI tools to solve this question. I need a fully manual, step-by-step solution with clear explanations, as if it were done by a human tutor. No AI-generated responses, please.arrow_forward
- Please do not use any AI tools to solve this question. I need a fully manual, step-by-step solution with clear explanations, as if it were done by a human tutor. No AI-generated responses, please.arrow_forwardPlease do not use any AI tools to solve this question. I need a fully manual, step-by-step solution with clear explanations, as if it were done by a human tutor. No AI-generated responses, please.arrow_forwardThis is an old practice exam. Fce = 110lb and FBCD = 62 lb but whyarrow_forward
- Precision Machining Technology (MindTap Course Li...Mechanical EngineeringISBN:9781285444543Author:Peter J. Hoffman, Eric S. Hopewell, Brian JanesPublisher:Cengage LearningUnderstanding Motor ControlsMechanical EngineeringISBN:9781337798686Author:Stephen L. HermanPublisher:Delmar Cengage LearningAutomotive Technology: A Systems Approach (MindTa...Mechanical EngineeringISBN:9781133612315Author:Jack Erjavec, Rob ThompsonPublisher:Cengage Learning
- Refrigeration and Air Conditioning Technology (Mi...Mechanical EngineeringISBN:9781305578296Author:John Tomczyk, Eugene Silberstein, Bill Whitman, Bill JohnsonPublisher:Cengage LearningElectrical Transformers and Rotating MachinesMechanical EngineeringISBN:9781305494817Author:Stephen L. HermanPublisher:Cengage LearningWelding: Principles and Applications (MindTap Cou...Mechanical EngineeringISBN:9781305494695Author:Larry JeffusPublisher:Cengage Learning





