image thumbnail

What's New for Object-Oriented Programming in MATLAB Webinar - Code Examples

by

 

10 Apr 2008 (Updated )

Code examples used in "What's New for Object-Oriented Programming in MATLABĀ®" Webinar

sads
classdef sads
    % Sensor Array data set class
    properties (Access=private)
        Wavelength   % Wavelength of sources (m)
    end
    properties (Constant)
        c=3e8;       % Speed in medium (m/s)
    end
    properties (Dependent)
        NumSensors   % Number of sensors
        NumSamples   % Number of samples
    end
    properties
        Data         % Sampled sensor data
    end
    properties (Access=private)
        Spacing      % Spacing of array (m)
        SampleRate   % Sample rate (Hz)
        Name         % Sensor array test run name
    end
    methods
        function obj=sads(Data, Wavelength,SampleRate,Spacing,Name)
            % SADS Create sensor array data set
            % Example:
            %  sads(Data, Wavelength,SampleRate,Spacing,Name)

            obj.Data=Data;
            obj.SampleRate=SampleRate;
            obj.Spacing = Spacing;
            obj.Name=Name;
            obj.Wavelength=Wavelength;
        end
        [mags, fflip]=magfft(obj,zeroPadTo)
        function NumSensors=get.NumSensors(obj)
            % Get NumSensors property
            NumSensors=size(obj.Data,2);
        end
        function NumSamples=get.NumSamples(obj)
            % Get NumSamples property
            NumSamples=size(obj.Data,1);
        end
        plot(obj)
        magfftplot(obj, zeroPadTo)
        angles=doa(obj)
        obj=steer(obj,theta)
    end
    methods (Static)
        showarray(Targets,NumSensors,Spacing)
    end
end

Contact us