フィルターのクリア

problem with determinant calculus

1 回表示 (過去 30 日間)
zini giacomo
zini giacomo 2018 年 2 月 8 日
コメント済み: Aveek Podder 2018 年 2 月 20 日
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 件のコメント
zini giacomo
zini giacomo 2018 年 2 月 8 日
Oops i've miss some parentesis
Aveek Podder
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 ExchangeCalculus についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by