please help!!
function [alphaijVHDL]=Inter_func(betaijVHDL,alphaijVHDL,EN_sp_i,sgn,pas,s2,sp,threshold)
temp1=0;
betaijSP=zeros(1,1152);
alphaijSP=zeros(1,1152);
for isp=0:sp-1
betaijSP=betaijVHDL(1+(pas+pas*(isp-1)) : pas+pas*isp);
coder.varsize('betaijSP',[1 1152]);
val1=betaijSP(betaijSP~=0);
dlin2=length(val1);
val3=zeros(1,dlin2);
if dlin2>=1
for j=1:dlin2
val2=val1;
val2=abs(val2);
val2(j)=10000;
min_local=min(val2);
%******************************************
if isp==0
if min_local<=threshold
val3(j)=s2*sgn(j+temp1)*min(val2);
elseif EN_sp_i(isp+2)==1
val3(j)=s2*sgn(j+temp1)*threshold;
else
val3(j)=s2*sgn(j+temp1)*min(val2);
end
else
if min_local<=threshold
val3(j)=s2*sgn(j+temp1)*min(val2);
elseif EN_sp_i(isp)==1
val3(j)=s2*sgn(j+temp1)*threshold;
else
val3(j)=s2*sgn(j+temp1)*min(val2);
end
end
end
alphaijSP=alphaijVHDL(1+(pas+pas*(isp-1)) : pas+isp*pas);
alphaijSP(betaijSP~=0)=val3;
alphaijVHDL(1+(pas+pas*(isp-1)) : pas+isp*pas)=alphaijSP;
end
temp1=dlin2+temp1;
end
end