フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to program Triagonometric function and give it's Jacobian matrix

2 ビュー (過去 30 日間)
Xiaolei Du
Xiaolei Du 2017 年 5 月 2 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
and I've give it's function, now my problem is to solve it's Jacobian Matrix
function y = TrigonometricFunctionN_10(x)
n = 10;
y = [];
for i = 1:n
f = 0;
for j = 1:n
f = f + cos(x(j));
end
y_i = n - f + i*(1 - cos(x(i))) - sin(x(i));
y = [y;y_i];
end

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 5 月 2 日
By inspection, for all j ~= i, the only term involving xj will be -cos(xj) (occurring during the summation), and the derivative of that is trivial to calculate. For j == i, you get only -cos(xi) - i * cos(xi) - sin(xi) which is also trivial to calculate the derivative of.
The Jacobian will therefore be 0 everywhere except the diagonal, and will be the derivative of -cos(xj) for all terms except diagonal entry i, where it will be the derivative of -(i+1)*cos(xi) - sin(xi)

この質問は閉じられています。

製品

Community Treasure Hunt

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

Start Hunting!