%% Create Measurement from Constant-Accelerating Object Using Measurement Parameters
% Define the state of an object moving in 2-D constant-acceleration motion. The state consists of position, velocity, and acceleration in each dimension. The measurements are in spherical coordinates with respect to a frame located at (20;40;0) meters from the origin.

state2d = [1,10,3,2,20,5].';

%
% The elevation of the measurement is zero and the range rate is negative indicating that the object is moving toward the sensor.

frame = 'spherical';
sensorpos = [20;40;0];
sensorvel = [0;5;0];
laxes = eye(3);
measurement = cameas(state2d,'spherical',sensorpos,sensorvel,laxes)

% The elevation of the measurement is zero and the range rate is negative. These results indicate that the object is moving toward the sensor.
%
% Put the measurement parameters in a structure and use the alternative syntax.

measparm = struct('Frame',frame,'OriginPosition',sensorpos,'OriginVelocity',sensorvel, ...
    'Orientation',laxes);
measurement = cameas(state2d,measparm)

% Copyright 2017 The MathWorks, Inc.
%