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 type_data = 11;
0018
0019
0020 type_robust = 0;
0021
0022
0023
0024
0025 out_C = 0;
0026
0027
0028
0029 print_type = 0;
0030 plot_type =0;
0031
0032
0033
0034 ss = plot_init;
0035
0036
0037 init_rand_seed(init_rand);
0038
0039
0040
0041
0042 display('----- demo reconstruct dem from 7 points with flattening and smoothing -----')
0043
0044
0045 [points,BB,delta_x,sigma_k,sigma_s,dem,out_in] = simulate_points_dem_0_flat;
0046
0047
0048
0049 starttime_flattening = cputime;
0050 ds_flat = smooth_dem_robust_bilinear_flat...
0051 (points,BB,delta_x,sigma_k,out_C,type_robust,type_data,...
0052 out_in,print_type,plot_type);
0053
0054 display([' time for solution flattening: ',num2str(cputime-starttime_flattening)])
0055
0056
0057 starttime_smoothing = cputime;
0058 ds_smooth = smooth_dem_robust_bilinear...
0059 (points,BB,delta_x,sigma_k,out_C,type_robust,type_data,...
0060 out_in,print_type,plot_type);
0061
0062 display([' time for solution smoothing: ',num2str(cputime-starttime_smoothing)])
0063
0064
0065
0066 figure('name','Fig 16.9 bottom: Best fitting 2D function','color','w',...
0067 'Position',[0.1*ss(1),0.2*ss(2),0.8*ss(1),0.5*ss(2)]);
0068
0069 subplot(1,2,1);hold on;
0070 plot_surface(ds_flat,BB,delta_x,'EdgeColor','none','FaceLighting','gouraud',...
0071 'ColorFct','smoothtanh','shading','interp','alpha',0.3,'view',[-20,30]);
0072 plot3(points(:,1),points(:,2),points(:,3),'.b','MarkerSize',15);
0073 axis equal
0074 title('flat dem with given points','FontSize',16)
0075
0076 subplot(1,2,2);hold on
0077 plot_surface(ds_smooth,BB,delta_x,'EdgeColor','none','FaceLighting','gouraud',...
0078 'ColorFct','smoothtanh','shading','interp','alpha',0.3,'view',[-20,30]);
0079 plot3(points(:,1),points(:,2),points(:,3),'.b','MarkerSize',15)
0080 axis equal
0081 title('smooth dem with given points','FontSize',16)
0082
0083
0084