Matlab - symsum with itegral

2 ビュー (過去 30 日間)
GSM
GSM 2015 年 12 月 11 日
回答済み: Walter Roberson 2015 年 12 月 11 日
Hello,
I am trying to calculate the following:
I am using the following code:
clear all;
close all
clc;
SNR0dB = 40;
SNR0 = 10 ^ (SNR0dB / 10);
LaserIntensity = 1877;
EffNoisePower = 4;
tmp_sigma = 20;
m=1;
rho=0.5;
H=1;
load coeffs
C = sqrt(SNR0*EffNoisePower) / LaserIntensity;
Zn_1 = inf;
Zn = C / 0.204;
syms k x
S1 = symsum(( ((rho*m)/(H^2*(1-rho^2)))^(m+2*k-1) ) * (1/(factorial(k)*gamma(m+k))) * integral(@(r1) r1.^(2*m+2*k+1).*exp((-r1.^2.*m)/(H^2*(1-rho^2))),Zn,Zn_1), k, 0, 10)
I get the following error:
Error using integralCalc/finalInputChecks (line 511)
Input function must return 'double' or 'single' values. Found 'sym'.
Error in integralCalc/iterateScalarValued (line 315)
finalInputChecks(x,fx);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 83)
[q,errbnd] = vadapt(@AToInfInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Error in SumOverIntegral (line 21)
S1 = symsum(( ((rho*m)/(H^2*(1-rho^2)))^(m+2*k-1) ) * (1/(factorial(k)*gamma(m+k))) * integral(@(r1)
r1.^(2*m+2*k+1).*exp((-r1.^2.*m)/(H^2*(1-rho^2))),Zn,Zn_1), k, 0, 10)
Can someone please help how to overcome the error of sending symbol to the integral function?
Thank you.

採用された回答

Walter Roberson
Walter Roberson 2015 年 12 月 11 日
Do not use integral() for symbolic expressions: use int()

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by