slow down the for loop operation for huge set of datas
1 回表示 (過去 30 日間)
古いコメントを表示
Hello Team,
I would like to increase the search operation in quite faster way, the below code i have implemented takes atleast 40mins to complete it because i have very huge data
for i = 1:length(LocationsListData.x) % which is approximately 26532957
idx = inpolygon(X(:),Y(:),LocationsListData.x(i),LocationsListData.y(i)) ;% X and Y has 4196*4196 size for each element
idx(idx==0)=[];
if~isempty(idx)
value(i) = idx;
end
end
do you see any possiblities to reduce the speed ? if so and then how can i do that ?
5 件のコメント
回答 (1 件)
Mohammad Sami
2020 年 4 月 3 日
You don't need to use the for loop with the inpolygon function.
idx = inpolygon(X(:),Y(:),LocationsListData.x,LocationsListData.y);
参考
カテゴリ
Help Center および 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!