Skip to content

Commit

Permalink
forgot to add the new m-file for checks in last commit...now done
Browse files Browse the repository at this point in the history
  • Loading branch information
GHilmarG committed Mar 12, 2019
1 parent 0b59899 commit 8a32614
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions SearchAndReplaceInverseFieldsInCtrlVar.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

function [InvertString,status]=SearchAndReplaceInverseFieldsInCtrlVar(InvertString)

status=true;

switch lower(InvertString)

case {'c','-c-'}
InvertString='-C-';
case {'aglen','-a-'}
InvertString='-AGlen-';
case {'b','-b-'}
if contains(InvertString,'B')
InvertString='-B-';
elseif contains(InvertString,'b')
error(' b inversion not possible, maybe try B inversion instead.')
end
case {'aglenc','caglen','-aglen-c-','-c-aglen-','ac','ca','-a-c-','-c-a-'}
InvertString='-AGlen-C-';
case {'logc','-logc-'}
InvertString='-logC-';
case {'loga','logaglen','-loga-','-logaglen-'}
InvertString='-logAGlen-';
case {'logaglenlogc','logaglen-logc','-loga-logc-','-logc-loga-','logclogaglen','logc-logaglen','-logaglen-logc-','-logc-logaglen-'}
InvertString='-logAGlen-logC-';
otherwise

status=false;

end

end

0 comments on commit 8a32614

Please sign in to comment.