mateq(X;Y)

Returns a boolean value indicating the equivalence of the two given matrices. (Available as of prod-9)

Function type

Vector only

Syntax

mateq(X;Y)

Input

Argument Type Description
X matrix model A column name

The column specified by this parameter must contain matrix models generated by the 1010data Matrix Functions.

Y matrix model A column name

The column specified by this parameter must contain matrix models generated by the 1010data Matrix Functions.

Return Value

Returns an integer value of 1 if the matrices specified by X and Y are equal; otherwise, returns 0.

Example

Consider the following example:

<table cols="name, data_1, data_2, data_3, data_4" title="mateq example">
John,8,0,5,1;
John,2,0,1,1;
Mary,3,1,2,2;
Mary,4,1,2,2;
John,5,2,3,1;
John,6,2,3,1;
Mary,7,3,4,2;
Mary,1,3,0,2
</table>
<willbe name="matrix_0" value="g_matrix(name;;;data_1 data_2 data_3 data_4;0)"/>
<willbe name="matrix_1" value="g_matrix(name;;;data_1 data_2 data_3 data_4;1)"/>
<willbe name="mat1_eq_mat0" value="mateq(matrix_1;matrix_0)"/>
<willbe name="mat1_plus_mat1" value="matplus(matrix_1;matrix_1)"/>
<willbe name="mat1_times_2" value="mattimes(matrix_1;2)"/>
<willbe name="plus_eq_times" value="mateq(mat1_plus_mat1;mat1_times_2)"/>

For every row, the value in mat1_eq_mat0 shows that the matrices in matrix_0 and matrix_1 are not equivalent.

However, mat1_plus_mat1 contains the result of adding matrix_1 to itself; clicking on the > character in the first row of the mat1_plus_mat1 column displays the matrix model for those rows where name is John.

mat1_times_2 contains the result of multiplying all of the elements in matrix_1 by 2; clicking on the > character in the first row of the mat1_times_2 column displays the matrix model for those rows where name is John.

The value in plus_eq_times shows that the matrices in mat1_plus_mat1 and mat1_times_2 are equal.