Index exceeds the number of array elements. Index must not exceed 4.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ivan
el 30 de Nov. de 2023
Editada: Image Analyst
el 1 de Dic. de 2023
m = 3;
k = 120;
w2 = k/m;
beta = 1/12;
gamma = 1/2;
dt1 = 1/sqrt(k/m);
t1 = 0:dt1:5;
nt1 = length(t1)
autovalores1 = zeros(nt1,1);
for i = 1:nt1
G1 = [(1-(1/2-beta)*w2.*t1(i).^2)/(1+(beta*w2.*t1(i).^2)),t1(i)/(1+(beta*w2.*t1(i).^2));
w2.*t1(i).*((gamma/2-beta)*w2.*t1(i).^2-1)/(1+(beta*w2.*t1(i).^2)),(1+(beta-gamma)*w2.*t1(i).^2)/(1+(beta*w2.*t1(i).^2))];
autovalores1(i) = abs(eig(G1(i)));
end
How do I fix this?
0 comentarios
Respuesta aceptada
Torsten
el 30 de Nov. de 2023
Editada: Torsten
el 1 de Dic. de 2023
Maybe you mean
for i = 1:nt1
G1 = [(1-(1/2-beta)*w2.*t1(i).^2)/(1+(beta*w2.*t1(i).^2)),t1(i)/(1+(beta*w2.*t1(i).^2));
w2.*t1(i).*((gamma/2-beta)*w2.*t1(i).^2-1)/(1+(beta*w2.*t1(i).^2)),(1+(beta-gamma)*w2.*t1(i).^2)/(1+(beta*w2.*t1(i).^2))];
autovalores1(i) = abs(max(eig(G1)))
end
?
Or maybe
autovalores1(i) = max(abs(eig(G1)))
? I'm not sure.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!