Professional Documents
Culture Documents
close all
clc;
syms x
n=5;
% n=input('Ingrese numero de puntos :')
x=linspace(0,1.5,n)
y=fnEvsp(x)
x1=linspace(0,1.5,50)
y1=fnEvsp(x1)
hold all
plot(x1,y1,'m')
xlabel('Eje (X)')
ylabel('Eje (Y)')
P=[x;y]
[ax,bx,cx,dx]=spline3(P)
for i=1:n-1
disp(['S(x)',num2str(i),'=',num2str(ax(i)),'','+(',num2str(bx(i)),')x+(',...
num2str(cx(i)),')x^2+(',num2str(dx(i)),'x^3)']);
end
x=
0
0.3750
0.7500
1.1250
1.5000
1.3180
y=
x1 =
Columns 1 through 7
0
0.0306
0.0612
0.0918
0.1224
0.1531
0.1837
Columns 8 through 14
0.2143
0.2449
0.2755
Columns 15 through 21
0.3061
0.3367
0.3673
0.3980
0.4286
0.4592
0.4898
0.5204
0.5510
0.5816
0.6122
0.7347
0.7653
0.7959
0.8265
0.9490
0.9796
1.0102
1.0408
1.1633
1.1939
1.2245
1.2551
1.3776
1.4082
1.4388
1.4694
Columns 22 through 28
0.6429
0.6735
0.7041
Columns 29 through 35
0.8571
0.8878
0.9184
Columns 36 through 42
1.0714
1.1020
1.1327
Columns 43 through 49
1.2857
1.3163
1.3469
Column 50
1.5000
y1 =
Columns 1 through 7
0
0.0000
0.0002
0.0008
0.0018
0.0036
0.0061
Columns 8 through 14
0.0097
0.0143
0.0202
0.0272
0.0353
0.0445
0.0543
0.0907
0.0948
0.0948
0.0892
Columns 15 through 21
0.0646
0.0745
0.0835
Columns 22 through 28
0.0766
0.0556
Columns 29 through 35
-0.2890 -0.3781 -0.4696 -0.5589 -0.6399 -0.7062 -0.7505
Columns 36 through 42
0.0147
Columns 43 through 49
0.2784
0.5547
0.8249
1.0675
1.2591
Column 50
1.3180
P=
0
0.3750
0.7500
1.1250
1.5000
1.3180
n=
5
z=
0 -0.7187 -3.0688 16.1417
c=
0
x=
0
0.1000
0.2000
0.3000
0 -0.0006
0.0049
0.0223
y=
x=
0.3750
0.4750
0.5750
0.6750
1.3772
1.4017
y=
0.0469
0.0912
0.1127
0.0660
0.8500
0.9500
1.0500
x=
0.7500
y=
-0.0410 -0.2875 -0.5561 -0.7213
x=
1.1250
1.2250
1.3250
1.4250
-0.7020 -0.4198
0.0991
0.7687
y=
ax =
0
1.3180
bx =
-0.0155
0.4062 -1.9370
1.3511
cx =
0
dx =
0.9997 -7.5536 20.9022 -14.3482
S(x)1=0+(-0.01555)x+(0)x^2+(0.99966x^3)
S(x)2=0.046885+(0.40618)x+(1.1246)x^2+(-7.5536x^3)
S(x)3=-0.040984+(-1.937)x+(-7.3732)x^2+(20.9022x^3)
S(x)4=-0.70197+(1.3511)x+(16.1417)x^2+(-14.3482x^3)