Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
150 views
Holly Moore MATLAB For Engineers, 3rd Edition CHAPTER 8
Uploaded by
Dewi R
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Holly Moore MATLAB for Engineers, 3rd Edition CHA... For Later
Download
Save
Save Holly Moore MATLAB for Engineers, 3rd Edition CHA... For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
150 views
Holly Moore MATLAB For Engineers, 3rd Edition CHAPTER 8
Uploaded by
Dewi R
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Holly Moore MATLAB for Engineers, 3rd Edition CHA... For Later
Carousel Previous
Carousel Next
Save
Save Holly Moore MATLAB for Engineers, 3rd Edition CHA... For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 6
Search
Fullscreen
MATLAB — HW CHAPTER 5 Problem: S.1_A sensor that monitors the temperatize of backyard hot tb records the data shown in Table 85. Table 8.5 Hot Tub Temperature Date Tine of Day __Temporatvre, F (0000 100 100 101 zu tz 2.00 toa 400 109 0500 Joa 06.00 low 7.00 tos a00 106 oF00 106 1009 108 1100 tos 1200 toa 1300 toa 1409 101 1500 100 1600 %9 17.00 oo 1800 oz 1900 104 2000 106 21-00 107 2200 los 2300 oe 2400 toa (a) The temperanare should never exceed 105°F.Use the #nd fetion to find dhe index numbers of the temperatuces that exceed the maximum allowable temper (b) Use the Length function wih the resulls from part (a) © devermine how many times the maxim allowable temperature was exceeded. (©) Determine at what times the temperature exceeded the maximum allovable temperature, using the index mumbers found in part (2) (2) The temperature should never be lower than 102°E Use the Eid func tion together with the Lengths function to determine how many times the temperature was les than the minimum allowable temperacure. (e) Determine at what times the temperature was less than the minimum allowable temperatare. (8) Determine at what times the temperature was within the allowable limits (ie. between 102°F and 105'T, inclusive) (2) Use the max function o determine the maximum temperatute reached andl the ime at which it occurred.MATLAB — HW CHAPTER 5 Script: ‘temp = [100, 161, 102, 103, 103, 104, 104, 105, 106, 106, 106, 105, 104, 103, 101, 100, 99, 1¢@, 102, 104, 106, 107, 105, 104, 104]; time = [0:24]; Find ‘temp>1@5) Tength(a) time(a) Length( Find(temp<102)) ‘time Find (temp162)) Find(tempe=105 & temp>=102); time(x) gi = max(temp) [val, idx] = max(temp); g2 = time(idx) Output: b 5 c a 9 1 2 2 d 6 e eo 1 mm 1 w ow fe. 2 3 4 S$ 6 7 WM 412 13 1 19 2 2 24 gi 107 g= aaMATLAB — HW CHAPTER 5 Problem: 8.6 Create a function called g that satisfies the following criteria: Forx<—m, (x) =-1 Forx=—wandx= 7, g(x) Forx> 7, a(x) =-1 Plot your results for values of x from 2x to +2, Choose your spacing to create a smooth curve. Script: function g = g(x) ind_1 = find(x<-pi); ind_3 = find(xspi); x8 = x(ind_3); L3 = length(ind_3); g3 = -1ones(1,11)3 8 = [et g2 83) Output: Problem:MATLAB — HW CHAPTER 5 SAT The inverse sine (asin) and inverse cosine (acos) functions are valid only for inputs between —1 and +1, because both the sine and the cosine have values only between —1 and +1 (Figure P8.11), MATLAB® interpret the result of acin or acos for avalue outside the range as a complex number. For example, we might have acoa(-2) 3.adas = 1.21708 which is 2 questionable mathematical result. Create a function called my_ ‘asin that accepis a single value of x and checks to see if it is between —T and +1(-1< =x < =1), If is ouside the range, send an error message to the screen. If it is inside the allowable range, return the value of “The sine function angle Script: disp(x) else end value = input('Enter the value between -1 to 1: Af value >= -1 & value <= 1 x = asin(value) disp(‘Error. Please input another value between -1 to 1") Output: Problem:MATLAB — HW CHAPTER 5 8.12 Create a program dat prompis the user to enter a scalar value for the out side air temperature. If the temperature is equal to or above 80°F, send a ‘message to the command window telling the user to wear shorts. Ifthe tem- perauure is between 60°F and 80°F send a message to the command window telling the user that it is a beautiful day. If the temperature is equal to or below 60°F, send a message to the command window telling the user to wear a jacket oF coat Script: ‘temp = input (‘Enter the outside temperature in fahrenheit: if temp>=8@ disp(‘Wear a short! The outside is hot. elseif temp<80 & temp>60 disp(‘It is 2 beautiful day. Enjoy!') elseif temp<=60 disp(‘Please, wear a coat or jacket.") end Problem: B16 Ava local universiy, cach engincering major requires a different number of credits for graduation, For example, recently the requirements were a8 follows: (Civil Engineering 190 Chemica gineering 190 Computer Engineering a2 Flanval Fagneerng 168 Mechanical Engiesing 129 Prompt the user to select an engineering program from a menu, Use a ewitch/case structure to send the minimum number of credits required for graduation back to the command window. Script: EngMajor = menu('Select an engineering program Listed below:", ‘Civil’, ‘Chemical’, ‘Computer’, Electrical’ ‘Mechanical’ ); disp( ‘Minimum number of credits required for graduation : ') switch EngMajor case 1MATLAB — HW CHAPTER 5 disp 30) case 2 disp('130") case 3 disp('122") case 4 disp('126.5") case 5 disp('129") end Output: eR z ti) i ae If select Civil, the result will be: Minimum number of credits required for graduation 130 If select Chemical, the result will be: Minimum number of credits required for graduation 130 If select Computer, the result will be: Minimum number of credits required for graduation 122 If select Electrical, the result will be: Minimum number of credits required for graduation 126.5 If select Mechanical, the result will be: Minimum number of credits required for graduation 129
You might also like
Solutions Manual Matlab A Practical Introduction Programming Problem Solving 2nd Edition Stormy Attaway
PDF
73% (41)
Solutions Manual Matlab A Practical Introduction Programming Problem Solving 2nd Edition Stormy Attaway
35 pages
Assignment 1 Answers PDF
PDF
No ratings yet
Assignment 1 Answers PDF
16 pages
Assignment & Quiz (Matlab)
PDF
100% (1)
Assignment & Quiz (Matlab)
24 pages
lab7 حوسبة
PDF
No ratings yet
lab7 حوسبة
8 pages
Advanced MATLAB Code
PDF
No ratings yet
Advanced MATLAB Code
43 pages
Sheet2 Solution
PDF
No ratings yet
Sheet2 Solution
7 pages
Home Work 2
PDF
No ratings yet
Home Work 2
25 pages
Ahmed
PDF
No ratings yet
Ahmed
7 pages
Lab 7 - Practice Session 1
PDF
No ratings yet
Lab 7 - Practice Session 1
5 pages
Programming 1: COMP 208
PDF
No ratings yet
Programming 1: COMP 208
7 pages
MATLAB Assignments
PDF
No ratings yet
MATLAB Assignments
12 pages
Chapter 6: MATLAB Programs Exercises
PDF
No ratings yet
Chapter 6: MATLAB Programs Exercises
30 pages
Review Sheet - Spring 2024
PDF
No ratings yet
Review Sheet - Spring 2024
2 pages
lab5_Section 1
PDF
No ratings yet
lab5_Section 1
3 pages
lab4_01
PDF
No ratings yet
lab4_01
3 pages
2
PDF
No ratings yet
2
10 pages
8a - A0124541r - Douglas Tan
PDF
No ratings yet
8a - A0124541r - Douglas Tan
5 pages
A 6 R (ssr)
PDF
No ratings yet
A 6 R (ssr)
8 pages
Computer-T17-Solution Assignment-OK - 230418 - 042205
PDF
No ratings yet
Computer-T17-Solution Assignment-OK - 230418 - 042205
18 pages
Lab session A-6 (1)
PDF
No ratings yet
Lab session A-6 (1)
19 pages
HW 02
PDF
100% (2)
HW 02
2 pages
Numerical Lab Assignment2
PDF
No ratings yet
Numerical Lab Assignment2
11 pages
Test 1
PDF
No ratings yet
Test 1
15 pages
arrays-g5cJH8yqcHcC7kDx
PDF
No ratings yet
arrays-g5cJH8yqcHcC7kDx
12 pages
Assignment-3_MEE1006
PDF
No ratings yet
Assignment-3_MEE1006
2 pages
Simulation Lab Unit I Solution
PDF
No ratings yet
Simulation Lab Unit I Solution
12 pages
Chapter1_Prob35
PDF
No ratings yet
Chapter1_Prob35
3 pages
Week 10 Matlab Lab
PDF
No ratings yet
Week 10 Matlab Lab
2 pages
CP Ec02 2020-21
PDF
No ratings yet
CP Ec02 2020-21
3 pages
Lab 06 MATLAB Programs (User-Defined Functions)
PDF
No ratings yet
Lab 06 MATLAB Programs (User-Defined Functions)
2 pages
ENEL2CMH1 - Applied Computer Methods
PDF
No ratings yet
ENEL2CMH1 - Applied Computer Methods
9 pages
Matlab Practice Set 2
PDF
No ratings yet
Matlab Practice Set 2
2 pages
EECS1560 test 1_Sample (1)
PDF
No ratings yet
EECS1560 test 1_Sample (1)
7 pages
Chp#7 Ex
PDF
No ratings yet
Chp#7 Ex
12 pages
Assignment Programming
PDF
No ratings yet
Assignment Programming
5 pages
PS2 - Selection Statements
PDF
No ratings yet
PS2 - Selection Statements
6 pages
4rth Semester Matlab Assignment Solved 70 Question
PDF
No ratings yet
4rth Semester Matlab Assignment Solved 70 Question
19 pages
0 Assignment 0
PDF
No ratings yet
0 Assignment 0
2 pages
Pre Solutions of Old Papers 1573360064915 1 1631425497745 1656220859798
PDF
No ratings yet
Pre Solutions of Old Papers 1573360064915 1 1631425497745 1656220859798
155 pages
Mat Lab Problems
PDF
No ratings yet
Mat Lab Problems
5 pages
Notes For Working in The Command Windows: Matlab Engineering // Second Year//Chemical Eng. Dept
PDF
No ratings yet
Notes For Working in The Command Windows: Matlab Engineering // Second Year//Chemical Eng. Dept
6 pages
Assignment 4
PDF
No ratings yet
Assignment 4
10 pages
arrays-fgq4Smn7Hgn78jrw
PDF
No ratings yet
arrays-fgq4Smn7Hgn78jrw
12 pages
MatLab Complete File PDF
PDF
No ratings yet
MatLab Complete File PDF
54 pages
IT18111 Lab Plan Detailed
PDF
No ratings yet
IT18111 Lab Plan Detailed
9 pages
HW 4
PDF
No ratings yet
HW 4
4 pages
Matlab Code 3
PDF
No ratings yet
Matlab Code 3
29 pages
Homework Matlab
PDF
No ratings yet
Homework Matlab
3 pages
Assignment-3_Tanmay
PDF
No ratings yet
Assignment-3_Tanmay
7 pages
Assign3 (T&T)
PDF
No ratings yet
Assign3 (T&T)
7 pages
General Assignment
PDF
No ratings yet
General Assignment
2 pages
Scripts and Function Files: Introduction To Computer For Engineers
PDF
No ratings yet
Scripts and Function Files: Introduction To Computer For Engineers
41 pages
CS110-Lab 8
PDF
No ratings yet
CS110-Lab 8
5 pages
Lab 1
PDF
No ratings yet
Lab 1
4 pages
Download the updated MATLAB for Engineers 5th Edition Moore Solutions Manual (PDF) containing all chapters.
PDF
100% (3)
Download the updated MATLAB for Engineers 5th Edition Moore Solutions Manual (PDF) containing all chapters.
54 pages
Machine Problem #08
PDF
No ratings yet
Machine Problem #08
6 pages
Lab 02 MATLAB
PDF
No ratings yet
Lab 02 MATLAB
8 pages
H1038 Programming For Engineers: Instructions
PDF
No ratings yet
H1038 Programming For Engineers: Instructions
3 pages
nUMERICAL 01
PDF
No ratings yet
nUMERICAL 01
9 pages