0% found this document useful (0 votes)
31 views3 pages

Omar Espita Perez 4°3

The document contains code for plotting and numerically integrating several functions over different intervals. It defines functions, plots the functions, calculates areas under the curves, and uses numerical integration to calculate the integrals of the functions over the given intervals. The numerical integrals are displayed for each function.

Uploaded by

Omar E Perez
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views3 pages

Omar Espita Perez 4°3

The document contains code for plotting and numerically integrating several functions over different intervals. It defines functions, plots the functions, calculates areas under the curves, and uses numerical integration to calculate the integrals of the functions over the given intervals. The numerical integrals are displayed for each function.

Uploaded by

Omar E Perez
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Omar Espita Perez

script
x=[-2*pi:pi/100:2*pi]
y=x.^(sin(x.^(1/3)));
f=@(w)
w^(sin(exp(w)));
plot(x,y)
h=area(x,y)
set(h,'Facecolor',[1
0 0])
[ r] = integra( f,2*pi,2*pi,5 )

43
grafica
6

r=
1

16.7763 + 2.2639i
0

-1

x=[-2:0.01:2]
y=exp(x);
f=@(w) exp(1/w);
plot(x,y)
h=area(x,y)
set(h,'Facecolor',[1
.5 .3])
[ r] = integra( f,2,2,5 )

r=
12.9022

-6

-4

-2

8
7
6
5
4
3
2
1
0
-2

-1.5

-1

-0.5

0.5

1.5

Omar Espita Perez


x=[-2*pi:pi/100:2*pi]
y=(exp(x)).*sin(x).^1/2;
f=@(w) (exp(w))*sin(w)^1/2;
plot(x,y)
h=area(x,y)
set(h,'Facecolor',[1
0 0])
[ r] = integra( f,2*pi,2*pi,5 )

43

90
80
70
60
50
40
30

r=
20

28.1630

10
0
-10

x=[-2*pi:pi/100:2*pi]
y=(cos(x).*tan(x).^1/
2);
f=@(w)
(cos(w)*tan(w)^1/2);
plot(x,y)
h=area(x,y)
set(h,'Facecolor',[.8
.3 .2])
[ r] = integra( f,2*pi,2*pi,5 )

-6

-4

-2

0.5
0.4
0.3
0.2
0.1
0
-0.1
-0.2

r=

-0.3

-0.4
-0.5

-6

-4

-2

Omar Espita Perez


x=[1:0.1:4]
y=exp(x).*x.^(-1/3);
f=@(w)exp(w).*w.^(1/3) ;
plot(x,y)
h=area(x,y)
set(h,'Facecolor',[.2
.5 .2])
[ r] = integra(
f,1,4,5 )

r =
36.7949

43

35

30

25

20

15

10

1.5

function [ r] = integra( f,a,b,n )


%UNTITLED Summary of this function goes here
%
Detailed explanation goes here
h=(b-a)/n;
c=(h/2)*(f(a)+f(b));
d=0;
k=b-a;
for i=a+k/n:k/n:b-k/n
d=d+f(i);
end
e=d*h;
r=c+e;
end

2.5

3.5

You might also like