Matrix cos. Did I write the expression and correctly?
1 view (last 30 days)
Show older comments
function M = cosM(A)
M=A;
for i=0:1:100
M=M-(-1)^i*A^(1*i+1)
end
end
0 Comments
Accepted Answer
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
0 Comments
More Answers (1)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!