Code covered by the BSD License  

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

image thumbnail
from What's New for Object-Oriented Programming in MATLAB Webinar - Code Examples by Stuart McGarrity
Code examples used in "What's New for Object-Oriented Programming in MATLABĀ®" Webinar

obj=steer(obj,theta)
function obj=steer(obj,theta)
% Steer array electronically by angle theta, returning a new
% array
delta=obj.Spacing; % Spacing
Wc=2*pi*(obj.c/obj.Wavelength); % Source frequency in radians per sec
phaseShift=exp(-j*Wc*delta*(0:obj.NumSensors-1)*sin(theta)/obj.c);
obj.Data=bsxfun(@times,obj.Data,phaseShift); % Multiply by phaseshift
end

Contact us at files@mathworks.com