ENGR 132 - QUIZ12

ENGR 132 - QUIZ12 - for format 22 Solution 1 any_var =...

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

View Full Document Right Arrow Icon
Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30 Tues/Thurs 9:30-11:30
Background image of page 1

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

View Full Document Right Arrow Icon
4/24/11 Quiz 12 The following data has been defined in Matlab, xvector = [ 0.15 0.30 0.45 0.60 0.75 0.90]; yvector = [ 3.15 1.54 2.23 5.98 4.67 8.02]; Write the lines of Matlab code required to, 1. Find the line of best fit 2. Display the line using fprintf statement with 2 decimal places (see example below
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for format) 22 4/24/11 Solution 1) any_var = polyfit(xvector,yvector,1) 2) m=any_var(1) b=any_var(2) fprintf(‘The line of best fit is y = %4.2f x + %4.2f \n’, m, b) +5 (+1 for each part) +1 (can be placed directly in fprintf statement) +1 (can be placed directly in fprintf statement) +3 ( ensure proper form and %#.2f – where # can be any reasonable value)...
View Full Document

{[ snackBarMessage ]}

Page1 / 3

ENGR 132 - QUIZ12 - for format 22 Solution 1 any_var =...

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

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