source: trunk/src/griddata_uvmat.m @ 399

Last change on this file since 399 was 399, checked in by sommeria, 9 years ago

implementation of thin plate interpolation (proj on planes with mode 'filter'), rationalisation of variable formats in civ_matlab

File size: 1013 bytes
Line 
1%'griddata_uvmat': function griddata_uvmat(vec2_X,vec2_Y,vec2_U,vec_X,vec_Y,'linear')
2%adapt the input of the matlab function griddata to the appropriate version of Matlab
3function ZI = griddata_uvmat(X,Y,Z,XI,YI)
4% if ~exist('rho','var')|| isequal(rho,0)
5    txt=ver('MATLAB');
6    Release=txt.Release;
7    relnumb=str2num(Release(3:4));
8    if relnumb >= 20
9        ZI=griddata(double(X),double(Y),double(Z),double(XI),double(YI),'linear',{'QJ'});
10    elseif relnumb >=14
11        ZI=griddata(X,Y,Z,XI,YI,'linear',{'QJ'});
12    else
13        ZI=griddata(X,Y,Z,XI,YI,'linear');
14    end
15% else %smooth with thin plate spline
16%     [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho);
17%     diff_norm=mean(Z_diff.*Z_diff)
18%     ind_good=find(abs(Z_diff)<5*diff_norm);
19%     nb_remove=numel(Z_diff)-numel(ind_good)
20%     if nb_remove>0
21%     X=X(ind_good);
22%     Y=Y(ind_good);
23%     Z=Z(ind_good);
24%     [ZI,Z_diff]=patch_uvmat(X,Y,Z,XI,YI,rho);
25%     diff_norm_new=mean(Z_diff.*Z_diff)
26%     end
27% end
Note: See TracBrowser for help on using the repository browser.