rec10_vallillo_HW01

rec10_vallillo_HW01 - Problem#1 disp'Problem#1 Answers...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem #1 disp('Problem #1 - Answers') tem_A=[55 62 60 61 63 65 62 59 58 56];tem_B=[54 59 62 64 68 68 62 59 57 53]; fprintf('There are %1.0f days that the temperature in pond A is above 60 degrees.\n',sum(tem_A>60)) fprintf('This happened on days %1.0f,%2.0f,%3.0f,%4.0f,and%5.0f.\n',find(tem_A>60)) fprintf('The temperatures in pond A when it was greater than of equal to that of pond B were %1.0f,%2.0f,%3.0f,%4.0f,%5.0fand%6.0f.\n',tem_A(tem_A>=tem_B)) Problem #1 - Answers There are 5 days that the temperature in pond A is above 60 degrees. This happened on days 2, 4, 5, 6,and 7. The temperatures in pond A when it was greater than of equal to that of pond B were 55,62, 62, 59, 58and 56. Problem #2 >> disp('Problem #2 - Answers') for x=[-5 3 15] if x<-1 y=exp(x+1);y6=y; y=2+cos(pi*x);y7=y; elseif x>=5 y=10*(x-5)+1;y8=y; end end x=[-5 3 15]; fprintf('When x=%1.0f, y=%.05f\n',x(1),y6) fprintf('When x=%1.0f, y=%1.0f\n',x(2),y7) fprintf('When x=%1.0f, y=%1.0f\n',x(3),y8) Problem #2 - Answers
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/27/2011 for the course BIO 101 taught by Professor Martin during the Spring '08 term at Rutgers.

Page1 / 3

rec10_vallillo_HW01 - Problem#1 disp'Problem#1 Answers...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online