Skip to content

Commit

Permalink
Update codelibraries.html
Browse files Browse the repository at this point in the history
  • Loading branch information
chezh583 authored Sep 3, 2024
1 parent eae0e48 commit 00e33b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions codelibraries.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ <h2>1. Matlab</h2>
<p style="background-color:grey;">datetime(1950,1,1) + seconds(1907798400);</p>

<p> 5. search index of lat/lon in a lat/lon grid </p>
function [I,J]=searchforloc(arg_lat,arg_lon,latgrid,longrid)
dist2=sum(bsxfun(@minus,cat(3,arg_lat,arg_lon),cat(3,latgrid,longrid)).^2,3);
[I,J]=find(dist2==min(dist2(:)));
end
function [I,J]=searchforloc(arg_lat,arg_lon,latgrid,longrid)<br>
dist2=sum(bsxfun(@minus,cat(3,arg_lat,arg_lon),cat(3,latgrid,longrid)).^2,3);<br>
[I,J]=find(dist2==min(dist2(:)));<br>
end<br>

</body>
</html>

0 comments on commit 00e33b9

Please sign in to comment.