How to avoid the two loops with a less memory consumption.
이전 댓글 표시
Hello everyone,
I have used two for loops for one problem. Can anyone suggest me a way to avoid the loops and reduce the time. is it possible to calculate A without using a for loop ? I am using R2015a.
for i=1:100000
for j=1:100000
A(i,j)=exp(-(x(i)-x(j))-(y(i)-y(j)));
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!