Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matlab - symsum with itegral

Status
Not open for further replies.

HellSpawn82

Electrical
Joined
Oct 30, 2015
Messages
2
Location
IL
Hello,

I am trying to calculate the following:
Forum_Q_qsbyg0.jpg


I am using the following code:
if true
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)
end


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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top