Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your available stack space can crash MATLAB and/or your computer.
8 views (last 30 days)
Show older comments
Hi, please how i can solve this problem:
Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your
available stack space can crash MATLAB and/or your computer.
My code:
function [Pmacro Pfemto] = UAQP_power_control_method(handles)
Pmacro_dbm = str2double(get(handles.edit1,'String'));
Pmacro = (10.^(Pmacro_dbm / 10)) / 1000;
Pfemto_max_dbm = str2double(get(handles.edit2,'String'));
Pfemto_max = (10.^(Pfemto_max_dbm / 10)) / 1000;
Pfemto_def_dbm = str2double(get(handles.edit4,'String'));
Pfemto_def = (10.^(Pfemto_def_dbm / 10)) / 1000;
target_SINR = str2double(get(handles.edit5,'String'));
coordVectors = get(handles.figure1, 'UserData');
numOfFemtocells = str2num(get(handles.edit20,'String'));
Pfemto_init = ones(1, numOfFemtocells)*Pfemto_def;
pow_default = str2num(get(handles.edit13,'String'));
coordVectors.powFemto = (ones(1, numOfFemtocells))*(10^(pow_default / 10)) / 1000;
Pfemto_last = coordVectors.powFemto;
Pfemto=zeros(1,numOfFemtocells);
N21 = str2double(get(handles.edit15,'String'));
N31 = str2double(get(handles.edit35,'String'));
N1=str2num(get(handles.edit47,'String'));
N2=str2num(get(handles.edit18,'String'));
N3=str2num(get(handles.edit19,'String'));
coordVectors = get(handles.figure1, 'UserData');
numOfFemtousers = handles.edit11;
numOfMacrocells = 1;
P0=10;
o2=0.4;
o1=0.9;
o3=0.1;
Q21=0.7;
Q31=0.3;
Q22=0.6;
Q32=0.2;
D=0.7;
Pfemto = zeros(1,numOfFemtocells);
a = o2*Q21*ones(N2,1);
b = o2*Q22*ones(N2,1 );
c = o2*Q31*ones(N3,1 );
d = o2*Q32*ones(N3,1);
SINR1=zeros(1,N1);
SINR2=zeros(1,N2);
SINR3=zeros(1,N3);
R = str2num(get(handles.edit11,'String'));
currentSINR=zeros(1,numOfFemtocells);
target_SINR = str2double(get(handles.edit5,'String'));
coordVectors = get(handles.figure1, 'UserData');
P1=Pfemto;
P2=P0+(N1*o1)+sum(a(1:N2))+(sum(c(1:N3))*D);
for i=1:numOfFemtocells
[row col]=size(i);
SINRp11= zeros(row,col);
SINRp12=zeros(row,col);
SINRp21 = zeros(row,col);
SINRp22 = zeros(row,col);
SINRp31 = zeros(row,col);
SINRp32=zeros(row,col);
SINR11=zeros(row,col);
SINR12=zeros(row,col);
SINR21=zeros(row,col);
SINR22=zeros(row,col);
SINR31=zeros(row,col);
SINR32=zeros(row,col);
for j=1:N1
[row col] = size(j);
x1 = coordVectors.femt_x(j);
y1 = coordVectors.femt_y(j);
x = [x1 x1 max(x1-R,0) min(x1+R,496)];
y = [min(y1+R,428) max(y1-R,0) y1 y1];
if (Pfemto == P1)
SINR11(j)=SINRfemto(x1, y1,j, handles);
%SINR11(j)=findRangeSINR(handles);
else
SINR12(j) = SINRfemto(x1, y1,j, handles);
%SINR12(j)=findRangeSINR(handles);
end
end
SINRp11=sum( SINR11(j)/N1);
SINRp12=sum(SINR12(j)/N1);
for k=1:N2
if (Pfemto == P1);
%set(handles.figure1, 'UserData', coordVectors);
SINR21(k)=SINRfemto(x, y,k, handles);
else
%coordVectors.powFemto = P2;
% set(handles.figure1, 'UserData', coordVectors);
SINR22(k) =SINRfemto(x, y, k, handles);
end
SINRp21=sum(SINR21(k)/N2);
SINRp22=sum(SINR22(k)/N2);
end
for l=1:N3
if (Pfemto == P1)
%set(handles.figure1, 'UserData', coordVectors);
SINR31(l)=SINRfemto(x, y, l, handles);
else
%set(handles.figure1, 'UserData', coordVectors);
SINR32(l) = SINRfemto(x, y, l, handles);
end
end
SINRp31=sum(SINR31(l)/N3);
SINRp32=sum(SINR32(l)/N3);
end
for i=1:numOfFemtocells
if (SINRp11> SINRp12 && SINRp21> SINRp22&& SINRp31> SINRp32)
Pfemto=P2;
else if (SINRp11> SINRp12 && SINRp21> SINRp22);
Pfemto(i)=P0+(N1*o1)+sum(a(1:N2))*D;
else if (SINRp11> SINRp12)
Pfemto(i)=P0+(N1*o1)+sum(a(1:N21))*D;
else
Pfemto=P1;
end
end
end
end
end
thanks.
6 Comments
Stephen23
on 18 Apr 2018
Edited: Stephen23
on 18 Apr 2018
@brahmi ibtissem: I still don't see anything obvious that would cause recursion of those functions. You should check if the filenames match the function names: this can cause recursion, and users can easily miss this. Double check the filenames against the function names!
If you still cannot find anything please upload your files in a new comment.
Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!