How do I vectorize this code below?
    3 ビュー (過去 30 日間)
  
       古いコメントを表示
    
       if(y+1 <= length(B))
         if(sum(ismember(closed(:,1:2),[x,y+1],'rows'))== 0)  
           cost = hMap(x,y)+ B(x,y+1); 
           if(cost< hMap(x,y+1))
             hMap(x,y+1) = cost;
             open = [open;x,y+1,cost]; 
           end
         end
       end
2 件のコメント
  Walter Roberson
      
      
 2016 年 10 月 23 日
				The open = [open;x,y+1,cost]; suggests it is in a loop, but we do not have information about which variable is being iterated over; we also do not have information about what the purpose of the code is.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


