transcend1 - % x is between 0 and 2 xmin = 0; xmax = 2;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%numerical solutions to equations fprintf('\nThis program solves the equation '); fprintf('-2x + 1 = x - 2\n' ); % We need to know approximately where our solution lies. % From plotting the left-hand side (LHS) and the right- % hand side(RHS) vs. x, I can see that my solution for
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % x is between 0 and 2 xmin = 0; xmax = 2; intv = .01; x = xmin : intv : xmax; %find function at each x point func = 3*x-3; %x value that makes function closest to zero is solution [value index] = min(abs(func)); fprintf('\nx= %.2f\n\n', x(index));...
View Full Document

This note was uploaded on 08/06/2010 for the course ENGR 3 taught by Professor Ben-yaakov during the Summer '08 term at UCSB.

Ask a homework question - tutors are online