problem with determinant calculus
1 次查看(过去 30 天)
显示 更早的评论
i've a problem in the calculus of the determinant of a matrix, which his components change in the time, the determinant calculated in the analytic way and with 'det' function results different.
function [w1,w]=singular5(q1,q2,t)
time=size(t);
time=time(2);
w=zeros(1,time);
w1=zeros(1,time);
for k=1:time
J=[-(sin(q1(k)+sin(q1(k)+q2(k)))) -sin(q2(k)) 0 0;-(cos(q1(k)+cos(q1(k)+q2(k)))) -cos(q2(k)) 0 0;0 0 1 0;1 1 0 1];
w1(k)=abs(sin(q1(k)-q2(k))+sin(q1(k)));
w(k)=abs(det(J));
end
% code
w1 and w result differnet!
2 个评论
Aveek Podder
2018-2-20
Hi,
Hope this helps:
function [w1,w]=singular5(q1,q2,t)
time=size(t);
time=time(2);
w=zeros(1,time);
w1=zeros(1,time);
for k=1:time
J=[-(sin(q1(k))+sin(q1(k)+q2(k))) -sin(q2(k)) 0 0;-(cos(q1(k))+cos(q1(k)+q2(k))) -cos(q2(k)) 0 0;0 0 1 0;1 1 0 1];
w1(k)=abs(sin(q1(k)-q2(k))+sin(q1(k)));
w(k)=abs(det(J));
end
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!