Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
%----------------------------------------------------------------------- |
---|
2 |
% [smin(i),nclosest(i)]=closestnode(xref,yref,xobs,yobs) |
---|
3 |
% This function is a matlab version of closestnode.f |
---|
4 |
% |
---|
5 |
% (xref,yref) is the reference grid |
---|
6 |
% (xobs,yobs) are the locations for which closest reference grid node |
---|
7 |
% numbers are desired |
---|
8 |
% |
---|
9 |
% Matlab5.1 commands |
---|
10 |
%----------------------------------------------------------------------- |
---|
11 |
function [smin,nclosest]=closestnode(xref,yref,xobs,yobs) |
---|
12 |
for i=1:length(xobs) |
---|
13 |
[smin(i),nclosest(i)]=min((xref-xobs(i)).^2.0+(yref-yobs(i)).^2.0); |
---|
14 |
end |
---|
15 |
%----------------------------------------------------------------------- |
---|