Changeset 581 for trunk/src/plot_field.m
 Timestamp:
 Mar 12, 2013, 12:52:13 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/plot_field.m
r569 r581 249 249 function errormsg=plot_text(FieldData,CellInfo,htext) 250 250 % 251 errormsg= [];251 errormsg=''; 252 252 txt_cell={}; 253 253 Data={}; … … 1045 1045 1046 1046 %decimate by a factor 2 in vector mesh(4 in nbre of vectors) 1047 check_decimate=0; 1047 1048 if isfield(PlotParam.Vectors,'CheckDecimate4') && PlotParam.Vectors.CheckDecimate4 1049 check_decimate=1; 1048 1050 diffy=diff(vec_Y); %difference dy=vec_Y(i+1)vec_Y(i) 1049 1051 dy_thresh=max(abs(diffy))/2; … … 1055 1057 nb_sel=length(ind_sel); 1056 1058 ind_sel=ind_sel(1:2:nb_sel);% take half the points on a line 1059 elseif isfield(PlotParam.Vectors,'CheckDecimate16') && PlotParam.Vectors.CheckDecimate16 1060 check_decimate=1; 1061 diffy=diff(vec_Y); %difference dy=vec_Y(i+1)vec_Y(i) 1062 dy_thresh=max(abs(diffy))/2; 1063 ind_jump=find(abs(diffy) > dy_thresh); %indices with diff(vec_Y)> max/2, detect change of line 1064 ind_sel=1:ind_jump(1);%select the first line 1065 for i=2:4:length(ind_jump)1 1066 ind_sel=[ind_sel (ind_jump(i)+1:ind_jump(i+1))];% select the odd lines 1067 end 1068 nb_sel=length(ind_sel); 1069 ind_sel=ind_sel(1:4:nb_sel);% take half the points on a line 1070 end 1071 if check_decimate 1057 1072 vec_X=vec_X(ind_sel); 1058 1073 vec_Y=vec_Y(ind_sel);
Note: See TracChangeset
for help on using the changeset viewer.