how to use exp for this problem

답변 (1개)

James Tursa
James Tursa 2022년 9월 21일

0 개 추천

You need to use the * operator to multiply in the denominator. E.g.,
w=exp(-(i-Un)^2/(2*sd^2))
If i is not a variable defined by you, it will be interpreted as the imaginary number sqrt(-1).

댓글 수: 1

I would recommend
w = exp(-(i-Un).^2./(2*sd.^2));
as that would be able to work on non-scalars as well.

댓글을 달려면 로그인하십시오.

카테고리

태그

질문:

2022년 9월 21일

댓글:

2022년 9월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by