classdef FunctionGenerator < Equipment %FUNCTION_GENERATOR Summary of this class goes here % Detailed explanation goes here properties (Dependent) waveform frequency voltage unit offset load end methods function wf = get.waveform(fg) wf = fg.query('FUNCtion:SHAPe?') end end methods (Static) function wf = getWave(inwf) wf = regexp(inwf, '(?i)(si|sq|[trndu1-7]|s)', 'match', 'once'); if isempty(wf) error('Invalid waveform.'); end wf = regexprep(wf, {'^(1|si|(?-i)s)$', '^(2|sq|(?-i)S)$', '^[3t]$', '^[4r]$', '^[5n]$', '^[6d]$', '^[7u]$'}, ... {'sinusoid', 'square', 'triangle', 'ramp', 'noise', 'dc', 'user'}, 'ignorecase'); end end end