2_Junak_Blake_LabHW10A

# 2_Junak_Blake_LabHW10A - 2.9688 2.9688 2.8125 2.8906 2.8906...

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

Blake Junak Section 2 function [xr]=LabHW10A(xl,xu) %Blake Junak %Section 2 %This function will determine the roots of a polynomal function %These are the original functions f_xu=-1.2*(xu^2)+1.35*xu+5.9; f_xl=-1.2*(xl^2)+1.35*xl+5.9; %If function if f_xl*f_xu>0 error( 'error' ) end %While function while abs(xu-xl)>.001 xr=(xl+xu)/2; f_xr=-1.2*(xr^2)+1.35*xr+5.9; if f_xl*f_xr<0 xu=xr; elseif f_xl*f_xr>0 xl=xr; else break end f_xl=-1.2*(xl^2)+1.35*xl+5.9; f_xu=-1.2*(xu^2)+1.35*xu+5.9; disp([xl,xu,xr]) end >> xl=0 xl = 0 >> xu=5 xu = 5 >> [xr]=LabHW10A(xl,xu) 2.5000 5.0000 2.5000 2.5000 3.7500 3.7500 2.5000 3.1250 3.1250

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

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

Unformatted text preview: 2.9688 2.9688 2.8125 2.8906 2.8906 2.8125 2.8516 2.8516 2.8320 2.8516 2.8320 2.8418 2.8516 2.8418 2.8467 2.8516 2.8467 2.8491 2.8516 2.8491 2.8491 2.8503 2.8503 2.8497 2.8503 2.8497 xr = 2.8497 >> xl=0 xl = >> xu=-5 xu =-5 >> [xr]=LabHW10A(xl,xu) 0 -2.5000 -2.5000-1.2500 -2.5000 -1.2500-1.2500 -1.8750 -1.8750-1.5625 -1.8750 -1.5625-1.7188 -1.8750 -1.7188-1.7188 -1.7969 -1.7969-1.7188 -1.7578 -1.7578-1.7188 -1.7383 -1.7383-1.7188 -1.7285 -1.7285-1.7236 -1.7285 -1.7236-1.7236 -1.7261 -1.7261-1.7249 -1.7261 -1.7249-1.7249 -1.7255 -1.7255 xr =-1.7255 >>...
View Full Document

## This note was uploaded on 04/02/2012 for the course EGR 102 taught by Professor Hinds during the Spring '09 term at Michigan State University.

### Page1 / 3

2_Junak_Blake_LabHW10A - 2.9688 2.9688 2.8125 2.8906 2.8906...

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

View Full Document
Ask a homework question - tutors are online