Matrix cos. Did I write the expression and correctly?

1 view (last 30 days)
function M = cosM(A)
M=A;
for i=0:1:100
M=M-(-1)^i*A^(1*i+1)
end
end

Accepted Answer

Ameer Hamza
Ameer Hamza on 28 Sep 2020
Edited: Ameer Hamza on 28 Sep 2020
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

More Answers (1)

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

Community Treasure Hunt

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

Start Hunting!