EasyManuals Logo

Tektronix DPO70000C/DX Series User Manual

Tektronix DPO70000C/DX Series
1002 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #780 background imageLoading...
Page #780 background image
Oscilloscope Reference MATLAB custom functions
Using a Class t
o create MATLAB functions
An dvanced user can create a MATLAB custom analysis function by subclassing
instrument.i
ntegration.AlgorithmDenition. The waterfall.m class shows an example of this type of
custom analysis function. This is more complex than using a function but allows more control of behavior
than the basic function capability. By using a subclass, you can implement custom tear-down behaviors,
such as closing p lots automatically when an analysis function is no longer being called.
Your class should be a subclass of instrument.integration.AlgorithmDenition:
classdef myClass < instrument.integration.AlgorithmDe nition
There are f
our methods your class may need to implement: a constructor, a destructor, a process, and a
stopProcessingHook. The default destructor and stopProcessingHook f rom the superclass may be sufcient
for your class. However, at minimum you need to implement a constructor and the process function:
classdef myClass < instrument.integration.AlgorithmDenition
methods
function obj = myClass(sampleRate,pointsPerRecord)
obj@instrument.integration.AlgorithmDenition(sampleRate,pointsPerRecord);
end
function [result] = process(obj,varargin)
result = varargin{1};
end
end
end
The constructor is called the rst time the analysis function is used in a specicmathexpressiononthe
instrument. Here anything that requires setup before processing data, such as plots, should be congured.
The parent constructor can be called from your custom construct if n ecessary (the constructor for
A
lgorithmDenition sets up some basic settings information about the instrument).
The process function is the main workhorse of the class. This function computs results and returns data to
the instrument. Like the custom analysis functions created using the basic function interface, the length of
the results returned by your process function should match the length of the input.
The stopProcessingHook function is called when the analysis function is no longer in use by the
instrument. This may happen when you edit or clear a math function, or in other s ituations when the
instrument math system expects t hat the state should be reset. For example, if your analysis function is
displaying a plot, this would be the time to close the plot.
Finally, the destructor is called when the analysis function is no longer in use. Typically you call the
stopProcessingHook function from here to aid in cleanup.
758 DSA/DPO70000D, MSO/DPO/DSA70000C, DPO7000C, and MSO/DPO5000 Series

Table of Contents

Other manuals for Tektronix DPO70000C/DX Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tektronix DPO70000C/DX Series and is the answer not in the manual?

Tektronix DPO70000C/DX Series Specifications

General IconGeneral
BrandTektronix
ModelDPO70000C/DX Series
CategoryTest Equipment
LanguageEnglish

Related product manuals