problem with determinant calculus
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Aveek Podder
el 20 de Feb. de 2018
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
Respuestas (0)
Ver también
Categorías
Más información sobre Calculus 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!