Multiplication of array function

In the following line how can I use multiplication instead of "sum" ?
(sum(arrayfun(@(i)acos(S(i,i))^2,1:size(S,1)))) ;

 采纳的回答

Voss
Voss 2023-8-26

3 个评论

Also, there is no need to use arrayfun because you can use diag to get the diagonal elements of S:

prod(acos(diag(S)).^2)
You're welcome!

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Operators and Elementary Operations 的更多信息

提问:

M
M
2023-8-26

评论:

2023-8-27

Community Treasure Hunt

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

Start Hunting!

Translated by