Professional Documents
Culture Documents
clc
clear
x=0.1:0.01:3;
y1=-x;
y2=log(x);
plot(x,y1,'r',x,y2,'m')
grid on
1.5
0.5
-0.5
-1
-1.5
-2
-2.5
-3
0 0.5 1 1.5 2 2.5 3
function y=f10(x)
y=x+log(x);
end
0.5000
b=
tolerancia =
1.0000e-008
>> [c]=bisec('f10',a,b,tolerancia)
c=
0.5671
Ejercicio2:
clc
clear
x=0.1:0.01:3;
y1=-2*x+7;
y2=3*log(x);
plot(x,y1,'r',x,y2,'g')
grid on
8
-2
-4
-6
-8
0 0.5 1 1.5 2 2.5 3
function y=f11(x)
y=-2*x+7-3*log(x);
end
a=
b=
2.5000
tolerancia =
5.0000e-008
>> [c]=bisec('f11',a,b,tolerancia)
c=
2.2702
Ejercicio 3:
clc
clear
x=-5:0.01:5;
y1=2*x.^2-6;
y2=-3*cos(x);
plot(x,y1,'r',x,y2,'m')
grid on
50
40
30
20
10
-10
-5 -4 -3 -2 -1 0 1 2 3 4 5
****
a=
-2
b=
-1
tolerancia =
1.0000e-009
>> [c]=bisec('f12',a,b,tolerancia)
c=
-1.8460
*****
a=
b=
tolerancia =
1.0000e-009
>> [c]=bisec('f12',a,b,tolerancia)
c=
1.8460
Ejercicio 4
clc
clear
x=-6:0.01:6;
y1=(x.^3)/2;
y2=6*x-4;
plot(x,y1,'r',x,y2,'m')
grid on
150
100
50
-50
-100
-150
-6 -4 -2 0 2 4 6
function y=f13(x)
y=(x.^3)/2-6*x+4;
end
*****
-4
b=
-2
tolerancia =
5.0000e-008
>> [c]=bisec('f13',a,b,tolerancia)
c=
-3.7588
*****
a=
b=
tolerancia =
5.0000e-008
>> [c]=bisec('f13',a,b,tolerancia)
c=
0.6946
*****
a=
b=
4
tolerancia =
5.0000e-008
>> [c]=bisec('f13',a,b,tolerancia)
c=
3.0642
Ejercicio 5:
clc
clear
x=2:0.01:5;
y1=6./x;
y2=exp(x/4);
plot(x,y1,'g',x,y2,'m')
grid on
3.5
2.5
1.5
1
2 2.5 3 3.5 4 4.5 5