classdef SCDclass_mdsparfixdimvectoridx < SCDclass_mdspar % A constant 1D vector real (single) MDS+ parameter % with linearly indicized name source. properties(Access=private) idxstart idxstop end methods function obj=SCDclass_mdsparfixdimvectoridx(srctdimodel, destparam, srcinterval, varargin) obj@SCDclass_mdspar(srctdimodel, destparam, varargin); obj.classname=mfilename; intervalchecker=@(x) isnumeric(x) && min(diff(x))==1 && max(diff(x))==1; assert(intervalchecker(srcinterval)); obj.idxstart=srcinterval(1); obj.idxstop=srcinterval(end); end function actualizedata(obj, shot) obj=obj.preactualizecommon(shot); obj.assignstring=sprintf('%s=temp;',obj.assignvar); obj.caststring=sprintf('%s=single(%s);',obj.assignvar,obj.assignvar); assignin('base','temp',obj.value); obj.postactualizecommon(shot); evalin('base','clear temp'); end function [obj, value] = getdata(obj,shot) obj=obj.actualizegetcmd('mdsvalue(''%s'')', shot); value=[]; for ii=obj.idxstart:obj.idxstop getcommandstr=sprintf(obj.getcommand, ii); str=sprintf('MDS+ error for parameter %s: %s', obj.modelparam, eval(getcommandstr)); assert(isnumeric(eval(getcommandstr)), str); value=[value; eval(getcommandstr)]; end value=single(value); end function printinfo(obj) obj.printinfocommon; fprintf(' Parameter source index interval is: %d:%d\n',obj.idxstart,obj.idxstop); end function entrystring = genMARTe2entry(obj, shot) entrystring=obj.genMARTe2entrycommon(shot); entrystring=[entrystring ' StartIdx=' num2str(obj.idxstart) ' StopIdx=' num2str(obj.idxstop) ' }']; end end end