Changeset 742


Ignore:
Timestamp:
06/03/09 10:03:22 (15 years ago)
Author:
Mathieu Morlighem
Message:

use strncmp instead of strcmp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/plot/plot_tensor.m

    r1 r742  
    1515
    1616%Figure out tensor type:
    17 if strcmpi(type(1:6),'strain'),
     17if strncmpi(type,'strain',6),
    1818        tensor=md.strainrate;
    19 elseif strcmpi(type(1:6),'stress'),
     19elseif strncmpi(type,'stress',6),
    2020        tensor=md.stress;
    21 elseif strcmpi(type(1:16),'deviatoricstress'),
     21elseif strncmpi(type,'deviatoricstress',16),
    2222        tensor=md.deviatoricstress;
    2323else
     
    2626
    2727%Figure out type of plot being requested
    28 if strcmpi(type(end-5:end),'tensor') | strcmpi(type,'strainrate') | strcmpi(type,'deviatoricstress') | strcmpi(type,'stress'),
     28if strncmpi(fliplr(type),fliplr('tensor'),6) | strcmpi(type,'strainrate') | strcmpi(type,'deviatoricstress') | strcmpi(type,'stress'),
    2929        plot_tensor_components(md,options_structure,width,i,tensor,type,plot_options);
    3030        return;
    31 elseif strcmpi(type(end-8:end),'principal'),
     31elseif strncmpi(fliplr(type),fliplr('principal'),9),
    3232        plot_tensor_principal(md,options_structure,width,i,tensor,type,plot_options);
    3333        return;
    34 elseif strcmpi(type(end-13:end-1),'principalaxis'),
     34elseif strncmpi(fliplr(type(1:end-1)),fliplr('principalaxis'),13),
    3535        plot_tensor_principalaxis(md,options_structure,width,i,tensor,type,plot_options);
    3636        return;
Note: See TracChangeset for help on using the changeset viewer.