Changeset 150 for trunk/src/plot_field.m


Ignore:
Timestamp:
Dec 3, 2010, 12:16:51 PM (13 years ago)
Author:
sommeria
Message:

various corrections for plotting and using view_field and get_field. The current field of uvmat or view_field is now stored in the structure userdata.axes3. Introduction of live correlation to test PIV (civ1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r147 r150  
    231231end
    232232
    233 % set graph aspect ratio
    234 if isfield(AxeData,'Mesh')
    235     Data.Mesh=AxeData.Mesh;
    236 end
     233% % set graph aspect ratio
     234% if isfield(AxeData,'Mesh')
     235%     Data.Mesh=AxeData.Mesh;
     236% end
    237237
    238238%set(haxes,'UserData',AxeData)
     
    448448            hlegend=legend(legend_str);
    449449            txt=ver('MATLAB');
    450             Release=txt.Release
    451             relnumb=str2num(Release(3:4));% should be changed to Version for better compatibility
     450            Release=txt.Release;
     451            relnumb=str2double(Release(3:4));% should be changed to Version for better compatibility
    452452            if relnumb >= 14
    453453                set(hlegend,'Interpreter','none')% desable tex interpreter
     
    474474    txt=ver('MATLAB');
    475475    Release=txt.Release;
    476     relnumb=str2num(Release(3:4));
     476    relnumb=str2double(Release(3:4));
    477477    if relnumb >= 14
    478478        set(htitle,'Interpreter','none')% desable tex interpreter
     
    928928    vec_U=reshape(vec_U,1,numel(vec_U));
    929929    vec_V=reshape(vec_V,1,numel(vec_V));
    930     MinMaxX=max(vec_X)-min(vec_X);
    931     MinMaxY=max(vec_Y)-min(vec_Y);
    932     AxeData.Mesh=sqrt((MinMaxX*MinMaxY)/length(vec_X));
     930     MinMaxX=max(vec_X)-min(vec_X);
     931%     MinMaxY=max(vec_Y)-min(vec_Y);
     932%     AxeData.Mesh=sqrt((MinMaxX*MinMaxY)/length(vec_X));
    933933    if  ~isfield(PlotParam.Vectors,'AutoVec') || isequal(PlotParam.Vectors.AutoVec,0)|| ~isfield(PlotParam.Vectors,'VecScale')...
    934934               ||isempty(PlotParam.Vectors.VecScale)||~isa(PlotParam.Vectors.VecScale,'double') %automatic vector scale
     
    937937            indsel=find(AxeData.FF==0);%indsel =indices of good vectors
    938938        else     
    939             indsel=[1:numel(vec_X)];%
     939            indsel=1:numel(vec_X);%
    940940        end
    941941        if isempty(vec_U)
     
    977977   
    978978    %decimate by a factor 2 in vector mesh(4 in nbre of vectors)
    979     if isfield(PlotParam.Vectors,'decimate4')&isequal(PlotParam.Vectors.decimate4,1)
     979    if isfield(PlotParam.Vectors,'decimate4') && isequal(PlotParam.Vectors.decimate4,1)
    980980        diffy=diff(vec_Y); %difference dy=vec_Y(i+1)-vec_Y(i)
    981981        dy_thresh=max(abs(diffy))/2;
     
    983983        ind_sel=1:ind_jump(1);%select the first line
    984984        for i=2:2:length(ind_jump)-1
    985             ind_sel=[ind_sel [ind_jump(i)+1:ind_jump(i+1)]];% select the odd lines
     985            ind_sel=[ind_sel (ind_jump(i)+1:ind_jump(i+1))];% select the odd lines
    986986        end
    987987        nb_sel=length(ind_sel);
     
    10421042    AxeData.F=[];
    10431043     AxeData.FF=[];
    1044     AxeData.Mesh=[];
     1044%     AxeData.Mesh=[];
    10451045    PlotParamOut=rmfield(PlotParamOut,'Vectors');
    10461046end
     
    11691169      hx = [x1;x2;x3];
    11701170      hy = [y1;y2;y3];
    1171     tri=reshape([1:3*length(uc)],3,[])';
     1171    tri=reshape(1:3*length(uc),3,[])';
    11721172    d = tri(:,[1 2 3 1])';
    11731173   
Note: See TracChangeset for help on using the changeset viewer.