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
0 个评论
采纳的回答
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
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!