Index exceeds the number of array elements. Index must not exceed 4.
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Torsten
2023-11-30
编辑:Torsten
2023-12-1
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!