您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

37 行
746B

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