Commit 045ef149 authored by Jakob Gabriel's avatar Jakob Gabriel
Browse files

misc.Gains: minor changes for readability

parent 6f211672
...@@ -149,13 +149,18 @@ classdef Gains < handle & matlab.mixin.Copyable ...@@ -149,13 +149,18 @@ classdef Gains < handle & matlab.mixin.Copyable
end % for it = 1 : numel(obj.outputType) end % for it = 1 : numel(obj.outputType)
end % dps.Output end % dps.Output
function gainSeries = series(gainHead, gainTail, inputOfHeadObj, outputNextOutput) function gainSeries = series(gainHead, gainTail, inputGainHead, outputGainTail)
% series implements the series interconnection of obj and gainNext. The % series implements the series interconnection of obj and gainTail. The new outputs are
% new outputs are those of obj, but the inputs are those of gainNext. The % those of gainHead, but the inputs are those of gainTail. The outputType outputGainTail
% outputType outputNextOutput of gainNext will be connected to the input % of gainTail will be connected to the input inputGainHead of gainHead.
% inputObj. arguments
thisHead = gainHead.get(inputOfHeadObj); gainHead misc.Gains;
thisTail = gainTail.gainOfOutput(outputNextOutput); gainTail misc.Gains;
inputGainHead string;
outputGainTail string;
end
thisHead = gainHead.get(inputGainHead);
thisTail = gainTail.gainOfOutput(outputGainTail);
gainSeries = misc.Gains(); gainSeries = misc.Gains();
for it = 1 : thisTail.numTypes for it = 1 : thisTail.numTypes
tempTail = thisTail.gain(it); tempTail = thisTail.gain(it);
...@@ -165,7 +170,7 @@ classdef Gains < handle & matlab.mixin.Copyable ...@@ -165,7 +170,7 @@ classdef Gains < handle & matlab.mixin.Copyable
"lengthOutput", thisHead.lengthOutput)); "lengthOutput", thisHead.lengthOutput));
end end
otherInputsOfHead = copy(gainHead); otherInputsOfHead = copy(gainHead);
otherInputsOfHead.remove(inputOfHeadObj); otherInputsOfHead.remove(inputGainHead);
gainSeries.add(otherInputsOfHead); gainSeries.add(otherInputsOfHead);
end % series() end % series()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment