rbmatlab 0.10.01
grid/@rectgrid/demo.m
00001 function demo(dummy)
00002 % function demo(dummy)
00003 % small script demonstrating the possibilities of the rectgrid
00004 % class.
00005 
00006 % Bernard Haasdonk 9.5.2007
00007 
00008 disp('');
00009 disp('initializing grid and different plot modes')
00010 params.xrange = [0,1];
00011 params.yrange = [0,2];
00012 params.xnumintervals = [10];
00013 params.ynumintervals = [15];
00014 params.verbose = 0;
00015 params.bnd_rect_index = [];
00016 g1 = rectgrid(params);
00017 
00018 params.shrink_factor = 0.9;
00019 params.plot_patch = 0;
00020 params.color = [1,0,0];
00021 params.axis_equal = 1;
00022 params.axis_tight = 1;
00023 subplot(1,2,1), plot(g1,params);
00024 title('line, shrink');
00025 
00026 params.plot_patch = 1;
00027 params.shrink_factor = 1.0;
00028 params.color = [0,1,0];
00029 subplot(1,2,2), plot(g1,params);
00030 title('patch, noshrink');
00031 
00032 disp('press key to continue');
00033 pause();
00034 
00035 disp('');
00036 disp('elementdata and vertexdata')
00037 
00038 figure;
00039 d = sqrt(g1.CX.^2+g1.CY.^2);
00040 subplot(1,2,1);
00041 plot_element_data(g1,d,params);
00042 title('element data');
00043 
00044 dv = sin(((g1.X-0.4).^2+(g1.Y-1.0).^2)*10);
00045 subplot(1,2,2);
00046 plot_vertex_data(g1,dv,params);
00047 title('vertex data');
00048 
00049 disp('press key to continue');
00050 pause();
00051 
00052 
00053 disp('');
00054 disp('sequence of data, please move slider')
00055 
00056 params.title = 'vertex data sequence';
00057 params.colorbar_location = 'WestOutside'
00058 ndata = 100;
00059 dv = zeros(g1.nvertices,ndata);
00060 for d = 1:ndata
00061   dv(:,d) = sin(((g1.X-0.4-0.5*d/ndata).^2+(g1.Y-1.0-0.2*d/ndata).^2)*10);
00062 end;
00063 params.plot = @plot_vertex_data;
00064 plot_sequence(dv,g1,params);
00065 
00066 disp('press key to continue');
00067 pause();
00068 
00069 
00070 disp(' ');
00071 disp('demonstration of grid inspect')
00072 
00073 inspect(g1);
00074 
00075 disp('press key to continue');
00076 pause();
00077 
00078 disp(' ');
00079 disp('display method of grid:')
00080 display(g1);
00081 
All Classes Namespaces Files Functions Variables