function [arMagnitude, arPhase, arFrequency] =...
    getMagPhase(tfTransferFunction, arFreqRange)
% getMagPhase
% [magnitude, phase] = getMagPhase(transFunc, freq)
%   This function returns the magnitude and phase of a transfer function at
%   a certain frequencies given in the input

%   Project: IMPACT
%   Title of Code: getMagPhase
%   Relevant additional documentation: N/A
%   Developer: Carlos Gonzalez
%   External Dependencies: NA
%
%   Disclaimer
%   CAUTION: It is strongly recommended that changes to this code
%   should be avoided without first consulting with SgurrControl
%   and acquiring permission. SgurrControl is not liable for any
%   damage caused as a result of unauthorised changes to this
%   document.

rMinFreq = arFreqRange(1);
rMaxFreq = arFreqRange(end);
[arMagnitudeReadIn, arPhaseReadIn, arFrequency] =...
    bode(tfTransferFunction,{rMinFreq,rMaxFreq});

arMagnitude = reshape(arMagnitudeReadIn,1,numel(arMagnitudeReadIn));
arPhase = reshape(arPhaseReadIn,1,numel(arPhaseReadIn));