Info
This question is closed. Reopen it to edit or answer.
can i speed up this code and get rid of nested for loop??
1 view (last 30 days)
Show older comments
%coeffs1 is n*3 matrix with unknown n,i have no idea about it through
processing%%
for k=1:length(coeffs1)
for i=1:length(unique(l))
[r2, c2]= find(l == i & pd<inf); % pd and l are matrices of 300*300
[r3, ~]=find(l==i & nc<inf); % nc is matrix of 300*300
if ~isempty(r2)
v=zeros(length(r2),1);
for n=1:length(r2)
v(n)=pd(r2(n),c2(n));
end
zbar=eval2dPoly(r2,c2,coeffs1(k,:)'); % Zbar is estimated new values using function eval2dPoly %%%%
m=abs(zbar-v);
r1=length(find(m==0));
if r1/ length(r3)>=0
lamda=10;%10
dc=lamda*m*exp(-r1/length(r3));
Dc(k,i)=sum(dc);
end
end
end
end
6 Comments
per isakson
on 4 Jan 2015
Edited: per isakson
on 4 Jan 2015
It's difficult to help without running the code, which is difficult without input data.
What's make you believe that it is the for-loops, which cause the problem?
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!