Question
can anyone help me figure out how fo write matlab code for these problems?
BME 2013 Spring 2019 Exam 3 Matlab Review Sheet 1. Given the vector of patient body temperatures T (98.6, 102, 101, 99,98.9,
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: Done accordingly. Please comment for any problem. Please Uprate. Thanks.

fever.m

prompt = 'Please give vector of temperatures. ';
T = input(prompt);
index=1;
haveFever=0;
noFever=0;
while index <= length(T)
if T(index) >= 99
haveFever=haveFever+1;
else
noFever=noFever+1;
end
index=index+1;
end
fprintf('%d persons have fever and %d persons dont have fever\n',haveFever,noFever);

Output:

>> fever Please give vector of temperatures. [98.6,102,101, 99,98.9,102.1,100.3,101.2] 6 persons have fever and 2 persons don

areas.m

choice=1;
while and(choice>0,choice <4)
prompt = 'Please choose for which you want to calculate area\n1)Cylinder\n2)Circle\n3)Rectangle\n4)Any other to exit.\n';
choice = input(prompt);
if choice==1
r = input('Enter Radius of Cylinder :');
h=input('Enter height of Cylinder :');
area = (2*pi*r*h)+(2*pi*r^2);
fprintf('Area of Cylinder = %0.3f\n', area);
elseif choice==2
radius = input('Enter Radius of Circle');
area = pi * radius^2;
fprintf('Area of Circle = %0.3f\n', area);
elseif choice==3
length = input('Enter Length of Rectangle :');
width=input('Enter width of Rectangle :');
area=length*width;
fprintf('Area of Circle = %0.3f\n', area);
end
  
end

Output:

>>areas Please choose for which you want to calculate area 1) Cylinder 2) Circle 3) Rectangle 4)Any other to exit. Enter Radi

Add a comment
Know the answer?
Add Answer to:
BME 2013 Spring 2019 Exam 3 Matlab Review Sheet 1. Given the vector of patient body temperatures ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT