Below is an example of the test codes I am using
% UTM Check
A = [2 1; 7 4];
[~, UTM, ~, ~] = ROINVERSE(A);
expected_UTM = [1 0.5 0.5 0; 0 1 -7 2]; % Manually calculate this
assert(isequal(round(UTM, 5), round(expected_UTM, 5)), "Upper triangular matrix UTM is incorrect.");
% RREF Check
A = [2 1; 7 4];
[~, ~, RREF, ~] = ROINVERSE(A);
expected_RREF = [1 0 4 -1; 0 1 -7 2]; % Manually calculate this
assert(isequal(round(RREF, 5), round(expected_RREF, 5)), "RREF is incorrect.");