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일

1 개 추천

댓글 수: 3

Voss
Voss 2023년 8월 26일

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)
M
M 2023년 8월 27일
@Voss Thanks!
Voss
Voss 2023년 8월 27일
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