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 type_data = 0;
0029 print_type = 0;
0030 plot_type = 0;
0031
0032
0033 init_rand_seed(init_rand);
0034
0035
0036
0037
0038 display('----- Fig. 16.20: Demo surface interpolation -----')
0039
0040
0041 [points,BB,delta_x,sigma_k,sigma_h,dem] = simulate_points_dem_0;
0042
0043
0044
0045 out_in=zeros(size(points,1),1);
0046
0047 [ds,S,Sigma,Np,Nr,Mc,ver,A,w,w_f,W] = smooth_dem_robust_bilinear...
0048 (points,BB,delta_x,sigma_k,out_C,type_robust,type_data,out_in,...
0049 print_type,plot_type);
0050
0051
0052
0053
0054
0055 ss = plot_init;
0056
0057
0058 figure('name','Fig 16.20 Demo surface interpolation','color','w',...
0059 'Position',[0.1*ss(1),0.2*ss(2),0.8*ss(1),0.5*ss(2)]);
0060
0061 subplot(1,2,1);hold on
0062 plot_surface(ds,BB,delta_x,'alpha',0.3,'view',[-29,65],'colormap','cool');
0063 for n=1:Np
0064 plot3(points(n,1),points(n,2),points(n,3),'.k','MarkerSize',15)
0065 end
0066 axis equal
0067 xlabel('x');ylabel('y');zlabel('z');
0068 title('Fitted surface','FontSize',16)
0069
0070
0071 subplot(1,2,2);hold on
0072 plot_surface(sqrt(S),BB,delta_x,'alpha',0.3,'view',[-29,65],'colormap','cool');
0073 z=zeros(Np,1);
0074 for n=1:Np
0075 z(n)=interpolate_bilinear(S,points(n,1),points(n,2),delta_x,BB,sigma_h);
0076 plot3(points(n,1),points(n,2),sqrt(z(n)),'.k','MarkerSize',15)
0077 end
0078 plot3(0,0,0,'.k')
0079 axis equal
0080 xlabel('x');ylabel('y');zlabel('\sigma_z');
0081 title('Standard deviations \sigma_z of the estimated grid points','FontSize',16)
0082
0083
0084