1 function animate_basisgen_error(detailed_data, params)
5 params.animation_pause = 0.10;
7 plot_params.plot_mode = '3d';
8 plot_params.view = [-24,22];
10 switch params.RB_generation_mode
11 case 'greedy_uniform_fixed'
12 par.numintervals = params.RB_numintervals;
13 par.range = params.mu_ranges;
16 error('RB_generation_mode not supported for animation');
20 set(gcf, 'Position', [50 50 800 700]);
23 disp('generating basisgen.avi');
24 mov = avifile(fullfile(rbmatlabresult,'basisgen_animat.avi'));
26 mov = set(mov,'Compression','None');
27 frame_rep = ceil(15*params.animation_pause);
30 errs_sequence = detailed_data.RB_info.post_errs_sequence;
31 est_sequence = detailed_data.RB_info.post_est_sequence;
33 %mu_values = detailed_data.RB_info.mu_sequence;
35 vertices = get(MMesh,'vertex');
37 for i = 1:size(detailed_data.RB_info.post_errs_sequence,2);
39 lambda = 1;%max(1, 10^(floor(log10(...
40 % min(est_sequence(:,i))/(2*max(errs_sequence(:,i))) ...
43 [err,j] = max(est_sequence(:,i));
44 [err,k] = max(errs_sequence(:,i));
45 % j = find_vector(mu_values(:,i+1), vertices',epsilon);
46 if (isempty(j) || length(j)>1)
47 error('vector not or multiply found in vertex list!!');
50 plot_leafvertex_data(est_sequence(:,i),MMesh,plot_params); hold on;
51 plot_leafvertex_data(errs_sequence(:,i)*lambda,MMesh,plot_params); hold on;
54 zlabel(['estimator above error (x', num2str(lambda), ')']);
56 set(gca,'ZTick',10.^(-5:0));
58 pause(params.animation_pause);
62 mov = addframe(mov,F);
65 plot3(vertices(j,1),vertices(j,2),est_sequence(j,i),...
66 '.','MarkerSize',30); hold on;
67 plot3(vertices(k,1),vertices(k,2),errs_sequence(k,i)*lambda,...
69 set(gca,'Zscale','log');
71 title(['Estimator vs. error plot over M_{train} after RB size N=
', ...
72 num2str(i), ', at t=T_{end}, with M=
', num2str(params.M), ...
73 ' and Mstrich=
', num2str(params.Mstrich)]);
78 mov = addframe(mov,F);
81 pause(params.animation_pause);
A hierarchical cubegrid of arbitrary dimension.