Вы находитесь на странице: 1из 1

* Yl?

B1':1

clc
clear all

;i!3l' i'.ioo" de newton-::"::::I;


::"1";::"::;";"" a la
1i:il;ffi:?i:,?:":
(x1) i'x1'\ +2;
i"1=ito

sorucj.on')

dfx1= (1/ (x1) ) -1;


error' ) i
error=inPut ('ingrese

error:abs (error)
ii."=t"p"t (' ingrese numero

maxrm o

de iteraciones'

);

N:0;

attotaPtox=error*1; >error cc
while
"---- (ahfl(errot"plo"l
;
xz--it- (fx1ldfxl-)(x2-xl);
erroraprox:abs
xL:x2
i"l-:' log (x1) - (x1) +2 i
dfxl :(1/ (x1) ) -1;

N<:Nmax)

N:N+1;_
'-J'

;li : sPrintf ('LA

.y

sol,ucroN Es:%f

EN EL INTENTO
SE EA CONSEGUIDO

%d'rxlrN) i
disp(tnP);

cIc

c].ear aII

Fll"ffiti?rii'i"lT:'::"1;l ''*"'os

desea ra media: ')

-S-0;

for i:1:n
('ingrese valor %d' ' i) ;
tm : sPrintf(tmp)
;
A(i) : input
S : S+A(i) ;
p : 5/n;
es %d'rP)i
tmp = sPrintf ('la media
disP (tnP)
end

"-foo,
fl,',,,,,.,,t;. l'"'":',.,..,.

cIc
clear aII

il;i't"rooo
('ingrese

sEcANrE')

;/

/\

el valor de x1: ') ;


de x2: ') ;
x2:inPut ('ingres el valor
rx1:ItS (x1) - (x1) +2
+2"

xl:inPut

fx}:Log(x2) - \xZ)
'--ot-r,put

'insrls" er ""t::--?;""'":":;::"cciones:
('ingrese numero max',
(

"=i"plt

&& n<nmax

*nii. abs(x2-x1)):error
n:n+1;
\ / $xl-fx2)
*S:*f-f*f* (1-x2
(x3) +2;
fx3:lo9

,.f,,,1,,'',r,.

(x3) -

xL:x2

fzl=fx2

t
I
I

")
--.,Y:"

, o.

.,...,1

"

');

;-:T I'
*1-

x4r' {X2-x sV W" t

^',,
IX2:-- l:>1 *,t--)3.>)
t*v
XJ =V?

FYt

"frL

x L'-v3

x2:x3

fx2:fx3

'lZ .. r n ;'-' ' r' ',:


:r'i'
Ir?
4* l' ' :{'
' g.(<.tvr.t
?(rter ' \nP-\LL'i"
,i ;.'.".
-& N{fJo*'
a4.>" 7
t""
T'il*
'e{^r'r
-')'.
c"-s 'x2
'

n:0;

.-

E-*1

c*d

"

guJ

-*'

)i,

Вам также может понравиться