0001
0002
0003
0004
0005
0006
0007
0008 addpath(genpath('../../General-Functions/'));
0009 addpath('Functions')
0010
0011 close all
0012
0013
0014
0015
0016 init_rand = 6;
0017
0018
0019 type_robust = 0;
0020
0021
0022
0023
0024 out_C = 1;
0025
0026
0027
0028 print_type = 0;
0029 plot_type = 0;
0030
0031
0032 init_rand_seed(init_rand);
0033
0034
0035
0036 disp('----- Fig. 16.20: Demo surface interpolation -----')
0037
0038
0039 [points,BB,delta_x,sigma_k,sigma_h,out_in,dem] = simulate_points_dem_0;
0040
0041
0042
0043 [ds,S,Sigma,Np,Nr,Mc,ver,A,w,w_f,W] = smooth_dem_robust_bilinear...
0044 (points,BB,delta_x,sigma_k,out_C,type_robust,out_in,...
0045 print_type,plot_type);
0046
0047
0048
0049
0050
0051 ss = plot_init;
0052
0053
0054 figure('name','Fig 16.20 Demo surface interpolation','color','w',...
0055 'Position',[0.1*ss(1),0.2*ss(2),0.7*ss(1),0.6*ss(2)]);
0056
0057 subplot(1,2,1);hold on
0058 plot_surface(ds,BB,delta_x,'alpha',0.3,'view',[-29,65],'colormap','cool');
0059 for n=1:Np
0060 plot3(points(n,1),points(n,2),points(n,3),'.k','MarkerSize',15)
0061 end
0062 axis equal
0063 xlabel('$x$');ylabel('$y$');zlabel('$z$');
0064 title('Fitted surface','FontSize',16)
0065
0066
0067 subplot(1,2,2);hold on
0068 plot_surface(sqrt(S),BB,delta_x,'alpha',0.3,'view',[-29,65],'colormap','cool');
0069 z=zeros(Np,1);
0070 for n=1:Np
0071 z(n)=interpolate_bilinear(S,points(n,1),points(n,2),delta_x,BB,sigma_h);
0072 plot3(points(n,1),points(n,2),sqrt(z(n)),'.k','MarkerSize',15)
0073 end
0074 plot3(0,0,0,'.k')
0075 axis equal
0076 xlabel('$x$');ylabel('$y$');zlabel('$\sigma_z$');
0077 title('Standard deviations $\sigma_z$ of the estimated grid points','FontSize',16)
0078
0079
0080