Code to get possible combinations of A
and B
that would satisfy the required condition -
nums = [0,2,3,4,5,6]
%// allcomb is a MATLAB File-exchange tool available at -
%// http://www.mathworks.in/matlabcentral/fileexchange/10064-allcomb
t1 = allcomb(nums,nums)
t2 = mod(prod(t1,2),7)==1
out_comb = t1(t2,:)
Output is -
out_comb =
2 4
3 5
4 2
5 3
6 6
This means that the possible combinations of A
and B
would be (assuming I
means 3x3 sized identity matrix) -
A is 2I, B is 4I and A is 4I, B is 2I %%// 2I would be 2.*I and so on
A is 3I, B is 5I and A is 5I, B is 3I
A is 4I, B is 2I and A is 2I, B is 4I
A is 5I, B is 3I and A is 3I, B is 5I
A is 6I, B is 6I and A is 6I, B is 6I
Thanks to the pointer by @Luis, note that you can mix and match these numbers as follows to have more combinations of A
and B
to choose from -
A as diag([2 4 6]) and B as [4 2 6])
A as diag([5 3 2]) and B as [3 5 4])