diff --git a/BearImpOptions.m b/BearImpOptions.m index 5c3f2f78369cd72d2fedc76fbae01a18e4a05000..50c75f738a07e40fa33a387edb03c94c36157527 100644 --- a/BearImpOptions.m +++ b/BearImpOptions.m @@ -122,12 +122,29 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m end methods (Hidden) - function charOut = char(obj) + function str = getOptionID(obj) + % Gerates an abbreviated string according to the options chosen + str = ['T' lower(obj.T.char(1)) '_B' lower(obj.B.char(1)) '_H' lower(obj.H.filmThicknessFormula.char(1)) ]; + if obj.H.thermalCorrection == 'on', str = [str 't']; end + if obj.H.starvationCorrection == 'on', str = [str 's']; end + if obj.H.roughnessCorrection == 'on', str = [str 'r']; end + str = [str '_C' lower(obj.C.outsideArea.char(1:2))]; + if obj.C.k_vh_factor == 'on' , str = [str 'k']; end + if obj.C.pressureDistribution == 'on' , str = [str 'p']; end + if obj.C.roughnessCorrection ~= 'off', str = [str 'r']; end + str = [str lower(obj.C.rhoRatio.char(1))]; + end + function charOut = char(obj,n) + arguments + obj + n {mustBeInteger} = [] + end if strcmp(obj.optionChosen,'default') && ~obj.hasSubSubOptions charOut = obj.defaultOption; else charOut = obj.optionChosen; end + if ~isempty(n), charOut = charOut(n); end end function stringOut = string(obj) @@ -138,6 +155,11 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m cellOut = {char(obj)}; end + function logicalOut = ne(obj,otherObj) + nargoutchk(0,1) + logicalOut = ~eq(obj,otherObj); + end + function [logicalOut,diffs] = eq(obj,otherObj) nargoutchk(0,2) logicalOut = true;