Matrix cos. Did I write the expression and correctly?

1 次查看(过去 30 天)
function M = cosM(A)
M=A;
for i=0:1:100
M=M-(-1)^i*A^(1*i+1)
end
end

采纳的回答

Ameer Hamza
Ameer Hamza 2020-9-28
编辑:Ameer Hamza 2020-9-28
It should be something like this
function M = cosM(A)
M=E; % I don't know how E is defined in that equation
for k=1:1:100
M=M+(-1)^k*A.^(2*k)/factorial(2*k);
end
end

更多回答(1 个)

Steven Lord
Steven Lord 2020-9-28
You can check your answer using the funm function in MATLAB.

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by