Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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