You are on page 1of 12

date

ans =
'23-Aug-2022'
clock
ans =
1.0e+03 *
2.0220 0.0080 0.0230 0.0130 0.0170 0.0261
clc
RGB = imread('C:\Users\DELL\Desktop\mario.jpg')
1080×1920×3 <a href="matlab:helpPopup uint8" style="font-
weight:bold">uint8</a> array
RGB(:,:,1) =
Columns 1 through 13
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
1 1 1 1 1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1 1 1 1 1
1
2 2 2 2 2 2 2 2 2 2 2 2
2
2 2 2 2 2 2 2 2 2 2 2 2
2
2 2 2 2 2 2 2 2 2 2 2 2
2
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0
0
1 1 1 1 1 1 1 1 1 1 1 1
1
2 2 2 2 2 2 2 2 2 2 2 2
2
4 3 4 3 4 3 4 3 4 3 4 3
4
7 5 7 5 7 5 7 5 6 4 6 4
6
8 8 8 8 8 8 8 8 7 7 7 7
7
15 15 15 15 15 15 15 15 14 14 13 13
12
22 20 22 20 22 20 22 20 21 19 20 18
19
29 27 29 27 29 27 29 27 28 26 27 24
25
35 35 35 35 35 35 35 35 34 34 33 32
32
43 43 43 43 43 43 43 43 42 42 41 41
40
53 53 53 53 53 53 53 53 52 51 51 50
49
62 62 62 62 62 62 62 62 61 61 60 60
59
73 73 73 73 73 73 73 73 72 71 71 68
69
86 86 86 86 86 86 85 85 84 84 84 82
83
99 99 99 99 99 98 98 98 97 95 94 94
94
115 115 113 113 113 113 113 112 111 111 111 109
108
126 126 126 125 125 125 125 123 123 123 122 121
121
135 135 135 133 133 133 133 132 132 132 132 129
129
140 140 140 140 140 139 139 139 139 138 138 137
137
147 147 147 145 145 145 145 144 145 145 144 142
142

76 76 76 76 81 82 82 82 82 81 80 79
73 73 74 75 79 80 81 82 83 82 82 81
71 72 73 73 78 79 81 82 83 83 83 83
70 70 70 71 76 77 79 81 82 83 83 84
69 69 69 69 73 73 75 77 78 80 81 81
69 69 69 70 70 70 71 72 73 74 76 76
71 71 71 72 70 69 69 69 69 69 70 71
72 72 73 74 71 70 69 67 66 66 66 66
74 74 75 76 74 72 70 67 66 65 65 65
75 77 78 80 79 77 74 70 66 64 62 61
72 73 75 77 78 76 74 70 67 65 64 63
64 66 69 71 75 74 72 69 67 66 65 65
60 61 65 68 74 73 72 70 69 69 69 69
58 60 64 66 73 73 72 71 70 70 71 71
61 62 65 67 73 72 71 71 71 71 72 72
64 66 68 70 72 72 71 70 70 71 72 72
67 68 70 71 72 72 71 70 70 71 71 72
70 70 70 70 69 69 69 69 69 71 72 73
70 69 69 69 68 68 68 69 70 72 74 75
69 67 66 66 68 68 69 70 72 74 77 78
69 67 65 65 68 68 69 71 73 76 78 80
70 68 66 65 69 69 70 71 73 76 78 80
72 70 69 68 71 71 71 71 73 75 76 77
73 72 72 72 73 72 72 71 72 73 74 74
75 74 74 75 74 73 72 71 71 71 72 72
fdifin(RGB,0.1,0.1,1,3);
x = [20:23:29:17:30:25:27:24:27.7:28]
x =
20 21 22 23 24 25 26 27 28
y=[7:6.1:4.1:4.5:3:5.8:5.2:5.6:4.1:4.3]
y =
1×0 empty <a href="matlab:helpPopup double" style="font-
weight:bold">double</a> row vector
clc
x = [20;23;29;17;30;25;27;24;27.7;28]
x =
20.0000
23.0000
29.0000
17.0000
30.0000
25.0000
27.0000
24.0000
27.7000
28.0000
y
y =
1×0 empty <a href="matlab:helpPopup double" style="font-
weight:bold">double</a> row vector
y=[7;6.1;4.1;4.5;3;5.8;5.2;5.6;4.1;4.3]
y =
7.0000
6.1000
4.1000
4.5000
3.0000
5.8000
5.2000
5.6000
4.1000
4.3000
clc
x
x =
20.0000
23.0000
29.0000
17.0000
30.0000
25.0000
27.0000
24.0000
27.7000
28.0000
y
y =
7.0000
6.1000
4.1000
4.5000
3.0000
5.8000
5.2000
5.6000
4.1000
4.3000
M = [x y]
M =
20.0000 7.0000
23.0000 6.1000
29.0000 4.1000
17.0000 4.5000
30.0000 3.0000
25.0000 5.8000
27.0000 5.2000
24.0000 5.6000
27.7000 4.1000
28.0000 4.3000
M
M =
20.0000 7.0000
23.0000 6.1000
29.0000 4.1000
17.0000 4.5000
30.0000 3.0000
25.0000 5.8000
27.0000 5.2000
24.0000 5.6000
27.7000 4.1000
28.0000 4.3000
p = finter(M,0)
17.0000 4.5000
20.0000 7.0000
23.0000 6.1000
24.0000 5.6000
25.0000 5.8000
27.0000 5.2000
27.7000 4.1000
28.0000 4.3000
29.0000 4.1000
30.0000 3.0000
<strong>Interpolacion de lagrange
</strong>
ans =
10 10
[Warning: Matrix is close to singular or badly scaled. Results may be
inaccurate. RCOND = 7.695649e-24.]
[> In <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('fin
ter/lagrange', 'C:\Users\usuario\Desktop\Ismaelxd\finter.m', 158)"
style="font-weight:bold">finter/lagrange</a> (<a href="matlab:
opentoline('C:\Users\usuario\Desktop\Ismaelxd\finter.m',158,0)">line
158</a>)
In <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('fin
ter', 'C:\Users\usuario\Desktop\Ismaelxd\finter.m', 19)" style="font-
weight:bold">finter</a> (<a href="matlab: opentoline('C:\Users\usuario\
Desktop\Ismaelxd\finter.m',19,0)">line 19</a>)
]
Polinomio:
(6532867440310715*x^9)/36893488147419103232 -
(5691556310171463*x^8)/144115188075855872 +
(2196371147003409*x^7)/562949953421312 -
(3941539976241879*x^6)/17592186044416 +
(1132672622756633*x^5)/137438953472 - (6917773139289013*x^4)/34359738368
+ (1753549610241859*x^3)/536870912 - (4553407450420663*x^2)/134217728 +
(6867986473110233*x)/33554432 - 1145925663663483/2097152

Elapsed time is 23.097302 seconds.

p =

(6532867440310715*x^9)/36893488147419103232 -
(5691556310171463*x^8)/144115188075855872 +
(2196371147003409*x^7)/562949953421312 -
(3941539976241879*x^6)/17592186044416 +
(1132672622756633*x^5)/137438953472 - (6917773139289013*x^4)/34359738368
+ (1753549610241859*x^3)/536870912 - (4553407450420663*x^2)/134217728 +
(6867986473110233*x)/33554432 - 1145925663663483/2097152
f = matllabFunction(p)
{Unrecognized function or variable 'matllabFunction'.
}
f = matlabFunction(p)
f =
<a href="matlab:helpPopup function_handle" style="font-
weight:bold">function_handle</a> with value:
@(x)x.*2.046819470259617e+8-
x.^2.*3.392552919999259e+7+x.^3.*3.266240675452834e+6-
x.^4.*2.013336965840139e+5+x.^5.*8.241277993923235e+3-
x.^6.*2.240506078261364e+2+x.^7.*3.901538908840879-
x.^8.*3.949310538439348e-2+x.^9.*1.770737267836173e-4-
5.464199369733253e+8

fdiff(f,2,25,26,0.1)
Diff hacia atras (xo < x)
Funcion original:
9 8 7
6 5 4
6532867440310713 x 5691556310171463 x 8785484588013637 x
3941539976241879 x 1132672622756633 x 6917773139289013 x
-------------------- - ------------------- + ------------------- -
------------------- + ------------------- - -------------------
36893488147419103232 144115188075855872 2251799813685248
17592186044416 137438953472 34359738368
3 2
1753549610241859 x 4553407450420663 x 3433993236555117 x
1145925663663483
+ ------------------- - ------------------- + ------------------ -
----------------
536870912 134217728 16777216
2097152
Derivada de orden: 2
7 6 5
4 3 2
58795806962796417 x 39840894171200241 x 184495176348286377 x
59123099643628185 x 5663363113783165 x 20753319417867039 x
-------------------- - -------------------- + --------------------- -
-------------------- + ------------------- - --------------------
4611686018427387904 18014398509481984 1125899906842624
8796093022208 34359738368 8589934592
5260648830725577 x 4553407450420663
+ ------------------ - ----------------
268435456 67108864
Valor real: -4.694933
Valor experimental: -4.551669
Error absoluto: 0.143264
Error relativo: -3.051452%
ans =
5×4 <a href="matlab:helpPopup table" style="font-weight:bold">table</a>
<strong>Iteracion</strong> <strong>X</strong>
<strong>Y</strong> <strong>Intervalos</strong>
<strong>_________</strong> <strong>____</strong>
<strong>______</strong> <strong>________________</strong>
1 25.8 7.187 "[ 25.8, 25.9 ]"
2 25.9 7.2315 "[ 25.9, 26 ]"
3 26 7.2307 "[ 26, 26.1 ]"
4 26.1 7.183 "[ 26.1, 26.2 ]"
5 26.2 7.0888 " "
Valor real = -4.694933
Valor experimental = -4.699602
Eror absoluto = 0.004669
Error relativo = -0.099450%
Error truncamiento = -0.000817
axis square
yline([3 7])
ylim([3 7])
ylim([3 7])
x = syms('x')
{Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('sym
s')" style="font-weight:bold">syms</a>
Using input and output arguments simultaneously is not supported.
}
x = sym('x')

x =

v = diff(f(x),sym('x'),1)

v =

(58795806962796417*x^8)/36893488147419103232 -
(5691556310171463*x^7)/18014398509481984 +
(61498392116095459*x^6)/2251799813685248 -
(11824619928725637*x^5)/8796093022208 +
(5663363113783165*x^4)/137438953472 - (6917773139289013*x^3)/8589934592 +
(5260648830725577*x^2)/536870912 - (4553407450420663*x)/67108864 +
3433993236555117/16777216

v1= matlabFunction(v)
v1 =
<a href="matlab:helpPopup function_handle" style="font-
weight:bold">function_handle</a> with value:
@(x)x.*(-6.785105839998518e+7)+x.^2.*9.798722026358502e+6-
x.^3.*8.053347863360556e+5+x.^4.*4.120638996961618e+4-
x.^5.*1.344303646956818e+3+x.^6.*2.731077236188615e+1-
x.^7.*3.159448430751479e-1+x.^8.*1.593663541052556e-
3+2.046819470259617e+8
desp = fintg(v1,20,30,30)
Funcion:
8 7 6
5 4 3
3674737935174777 x 711444538771433 x 1921824753627983 x
5912309964362817 x 2831681556891583 x 6917773139289013 x
------------------- - ------------------ + ------------------- -
------------------- + ------------------- - -------------------
2305843009213693952 2251799813685248 70368744177664
4398046511104 68719476736 8589934592
2
5260648830725577 x 4553407450420663 x 3433993236555117
+ ------------------- - ------------------ + ----------------
536870912 67108864 16777216
Integral de f(x) [20.00 ; 30.00 = -3.999922]
Elapsed time is 3.469972 seconds.
Metodo Intervalos Teorico Real Error Metodo
Error Abs Error Relativo
_____________ __________ ________ ________ ____________
_________ ______________
"Simpson 3/8" 20 21 -49.996 -50.038 -0.058895
0.041551 -0.00083038
"Simpson 3/8" 21 22 32.591 32.6 0.12265
0.0089527 0.00027462
"Simpson 3/8" 22 23 16.523 16.538 0.084783
0.015386 0.00093031
"Simpson 3/8" 23 24 -0.50531 -0.49999 -0.00069519
0.005325 -0.01065
"Simpson 3/8" 24 25 0.20357 0.20001 -0.037305
0.0035628 0.017813
"Simpson 3/8" 25 26 1.4342 1.4307 -0.0038608
0.0035334 0.0024698
"Simpson 3/8" 26 27 -2.0339 -2.0306 0.04552
0.0032451 -0.0015981
"Simpson 3/8" 27 28 -0.90468 -0.89998 -0.018578
0.0046931 -0.0052147
"Simpson 3/8" 28 29 -0.1788 -0.19999 -0.40087
0.021195 -0.10598
"Simpson 3/8" 29 30 -0.99365 -1.1 -1.3814
0.10634 -0.096669
"Resumen" 20 30 -3.8613 -3.9999 -1.6486
0.13858 -0.034645
desp =
-3.8613
xlim([20 30])
date
ans =
'23-Aug-2022'
clock
ans =
1.0e+03 *
2.0220 0.0080 0.0230 0.0130 0.0180 0.0437
diary off

You might also like