|
53 | 53 | % for 8 inputs, all parameter properties are provided |
54 | 54 | % |
55 | 55 | % params.addParameter('Tails Roughness'); |
| 56 | + |
| 57 | + % Set the default parameters |
| 58 | + values = [0.0, 0.0, 0.0]; |
| 59 | + fit = false; |
| 60 | + priorType = priorTypes.Uniform.value; |
| 61 | + priorValues = [0, Inf]; |
| 62 | + |
56 | 63 | if isempty(varargin) |
57 | | - % No input parameter |
58 | | - % Add an empty parameter row |
| 64 | + % No input parameter - create name and add defaults |
59 | 65 | name = sprintf('new parameter %d',obj.autoNameCounter); |
60 | | - newRow = {name,0,0,0,false,priorTypes.Uniform.value,0,Inf}; |
| 66 | + newRow = {name, values(1), values(2), values(3), fit, priorType, priorValues(1), priorValues(2)}; |
61 | 67 | obj.addRow(newRow{:}); |
62 | 68 | end |
63 | 69 |
|
|
72 | 78 | % If length is 1, assume name only |
73 | 79 | % and fill in the rest with defaults |
74 | 80 | name = inputCell{1}; |
75 | | - values = [1, 2, 3]; |
76 | | - fit = false; |
77 | | - priorType = priorTypes.Uniform.value; |
78 | | - priorValues = [0, Inf]; |
79 | 81 |
|
80 | 82 | switch length(inputCell) |
81 | 83 | case 1 |
|
126 | 128 | if ~isnumeric(priorValues) |
127 | 129 | throw(exceptions.invalidType('Prior values must be numeric')); |
128 | 130 | end |
129 | | - |
| 131 | + |
130 | 132 | newRow = {name, values(1), values(2), values(3), fit, priorType, priorValues(1), priorValues(2)}; |
131 | 133 | obj.addRow(newRow{:}); |
| 134 | + |
132 | 135 | end |
133 | 136 | end |
134 | 137 |
|
|
0 commit comments