Changeset 757 for trunk/src/series.m


Ignore:
Timestamp:
Apr 29, 2014, 10:10:30 AM (10 years ago)
Author:
sommeria
Message:

a few bug repairs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r752 r757  
    757757        set(handles.num_incr_i,'String',num2str(diff_i_max(1)))% detect an increment to dispaly by default
    758758    end
    759     if isequal (diff_j_max,diff_j_max(1)*ones(size(diff_j_max)))
     759    if ~isempty(diff_j_max) && isequal (diff_j_max,diff_j_max(1)*ones(size(diff_j_max)))
    760760        set(handles.num_incr_j,'String',num2str(diff_j_max(1)))
    761761    end
     
    771771MaxIndex_i_table=get(handles.MaxIndex_i,'Data');%retrieve the min indices in the table MinIndex
    772772MaxIndex_j_table=get(handles.MaxIndex_j,'Data');%retrieve the min indices in the table MinIndex
     773if ~isempty(MinIndex_i)&&~isempty(MaxIndex_i)
    773774MinIndex_i_table(iview,1)=MinIndex_i;
     775MaxIndex_i_table(iview,1)=MaxIndex_i;
     776end
     777if ~isempty(MinIndex_j)&&~isempty(MaxIndex_j)
    774778MinIndex_j_table(iview,1)=MinIndex_j;
    775 MaxIndex_i_table(iview,1)=MaxIndex_i;
    776779MaxIndex_j_table(iview,1)=MaxIndex_j;
     780end
    777781set(handles.MinIndex_i,'Data',MinIndex_i_table)%display the min indices in the table MinIndex
    778782set(handles.MinIndex_j,'Data',MinIndex_j_table)%display the max indices in the table MaxIndex
     
    969973    pair_max=squeeze(max(SeriesData.i1_series{iview},[],1)); %max on pair index
    970974    j_max{iview}=max(pair_max,[],1);%max on j index
     975    if ~isempty(j_max{iview})
    971976    MaxIndex_i(iview)=max(find(j_max{iview}))-1;% max ref index i
    972977    MinIndex_i(iview)=min(find(j_max{iview}))-1;% min ref index i
     978    end
    973979end
    974980MinIndex_i=min(MinIndex_i);
     
    11351141pos_first=(ref_i_1-MinIndex_i)/(MaxIndex_i-MinIndex_i+1);
    11361142pos_last=(ref_i_2-MinIndex_i+1)/(MaxIndex_i-MinIndex_i+1);
     1143if isempty(pos_first), pos_first=0; end
     1144if isempty(pos_last), pos_last=1; end
    11371145Position=get(handles.Waitbar,'Position');% position of the waitbar:= [ x,y, width, height]
    11381146Position_status=get(handles.FileStatus,'Position');
    11391147Position(1)=Position_status(1)+Position_status(3)*pos_first;
    1140 Position(3)=Position_status(3)*(pos_last-pos_first);
     1148Position(3)=max(Position_status(3)*(pos_last-pos_first),0.001);% width must remain positive
    11411149set(handles.Waitbar,'Position',Position)
    11421150update_waitbar(handles.Waitbar,0)
Note: See TracChangeset for help on using the changeset viewer.