{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ENGR 132 - QUIZ4

ENGR 132 - QUIZ4 - 2 r A C 2 for[A,C]= 2 for circle_calcs 2...

This preview shows pages 1–6. Sign up to view the full content.

Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30

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

View Full Document
4/24/11 Quiz 4 The following function is available in the current folder in Matlab. The input argument is circle radius and output arguments are area and circumference. A vector of circle radii has been created in Matlab in the command window, >> r=1:4 Write the line of code that must be entered into the function [area_c,circum_c]=circle_calcs(radius ) % header area_c=pi*radius.^2; circum_c=2*pi*radius;
4/24/11 Solution 1. [A,C] = circle_calcs(r)

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2. r, A, C +2 for [A,C]= +2 for circle_calcs +2 for (r) +4 (all or nothing) Click to edit Master subtitle style 4/24/11 ENGR 132 Thurs/Tues 9:30-11:30 4/24/11 Quiz 4 The following function exists in the current folder in Matlab The following has been entered in the Matlab command window >> c=5; >> d=2; function [x,y]=my_function(a,b) % header comments c=-1; x=c*b; y=a+c; 4/24/11 Solution c = 5 d = 2 v = -2 w = 4 +2 +2 +2 +2 +2 for not including a, b, x, or y (all or nothing)...
View Full Document

{[ snackBarMessage ]}

Page1 / 6

ENGR 132 - QUIZ4 - 2 r A C 2 for[A,C]= 2 for circle_calcs 2...

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

View Full Document
Ask a homework question - tutors are online