%% Evaluate Equality of Two Variables
% Create a requirement object, and specify that the elements of two variables should be equal to each other.

Requirement = sdo.requirements.RelationalConstraint('Type','==');

%
% Specify test data for the two variables.

varData1 = [20 15];
varData2 = [20 55];

%
% Evaluate whether the test data satisfies the requirement.

Evaluation = evalRequirement(Requirement,varData1,varData2)

% Evaluation is the same size as the test data. When the relation type is specified as '==', if the requirement is satisfied, evalRequirement returns 0, the difference between the elements. If the requirement is violated, Evaluation is a non-zero number equal to the difference between the two elements.
% The first elements of the two variables are equal, so the requirement is satisfied and Evaluation(1) is 0.
% The second elements, 15 and 55, violate the requirement, resulting in a non-zero Evaluation(2).
% Copyright 2012 The MathWorks, Inc.