syms f i
f= 10e6;
g(1) = 0.09;
g(2) = -0.012;
g(3) = 0.012;
g(4)= -0.012;
g(5) = 0.022;
d(1) = 100; d(2) = 130; d(3) = 160; d(4) = 190; d(5) = 300;
K= 1;
a0 = 0;
a1 = 1.65e-9;
Vp= 1.53e8;
F = 50;
H(f) = symsum(g(1i).exp-(a0+a1F)^d(1i).exp-(0.000000205*d(1i)*j),1i,1,5);

답변 (1개)

Walter Roberson
Walter Roberson 2019년 10월 2일
편집: Walter Roberson 2019년 10월 2일
MATLAB uses .* or * for multiplication, not period
MATLAB does not have implicit multiplication. MATLAB will not know that a1F is intended to mean a1*F
Your equation does not involve F , it involves f . MATLAB is case sensitive.
MATLAB uses exp(-expression) for , not exp-expression
The second parameter of symsum needs to be a symbolic variable name, but you have used 1i instead.
You are trying to use 1i as an index, but complex numbers can never be used as indices.
When you use symsum(), you can never use the variable of summation as a matrix index.
What you need to do is vectorize:
H(f) = sum( g .* exp(-(a0+a1*f.^k).*d) .* exp(-1j*2*pi*f.*d./Vp) )

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by