problemas de index exceeds matrix dimensions
Publicado por Ivan (3 intervenciones) el 14/07/2018 00:19:34
una consulta, como puedo evaluar la funcion polinomica obtenida si me tirra error" indeex exceeds matrix dimensions" cuando la evaluo en 0.05 y 2.03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
grado=length(tiempo);
b(1:grado)=0;
tiempo(1)=0.5;amplitud(1)=2.99250;
tiempo(2)=1.0;amplitud(2)=0.42340;
tiempo(3)=1.5;amplitud(3)=2.75480;
tiempo(4)=3.5;amplitud(4)=27.4355;
f_x1_x0=(amplitud(2)-amplitud(1))/(tiempo(2)-tiempo(1));
f_x2_x1=(amplitud(3)-amplitud(2))/(tiempo(3)-tiempo(2));
f_x3_x2=(amplitud(4)-amplitud(3))/(tiempo(4)-tiempo(3));
f_x2_x1_x0=(f_x2_x1-f_x1_x0)/(tiempo(3)-tiempo(1));
f_x3_x2_x1=(f_x3_x2-f_x2_x1)/(tiempo(4)-tiempo(2));
f_x3_x2_x1_x0=(f_x3_x2_x1-f_x2_x1_x0)/(tiempo(4)-tiempo(1));
b0=amplitud(1);
b1=f_x1_x0;
b2=f_x2_x1_x0;
b3=f_x3_x2_x1_x0;
f=@(tiempo) b0+b1*(tiempo-tiempo(1))+b2*((tiempo-tiempo(1)).*(tiempo-tiempo(2)))+b3*((tiempo-tiempo(1)).*(tiempo-tiempo(2)).*(tiempo-tiempo(3)));
plot(tiempo,f(tiempo) , 'r');
grid on;
title('TiempoVSAmplitud');
xlabel('Tiempo');
ylabel('Amplitud');
feval(f,0.05);
feval(f,2.03);
Valora esta pregunta


0