% Script/Function Filename:
%     AtimesBGUI.m
% Purpose:
%     Enter the purpose of the function/file here
%     
% Record of modifications:
%     Programmer(s): {Your Name}
%     Date Due: YYYY-MM-DD
%     Date Submitted: YYYY-MM-DD
%     References: ????
%     Help Received: ????
%     
% Variables Used:
%     Enter the other variables that you use here
close all;
rng shuffle;

A = randi( 10 , randi( 5 ) + 1 , randi( 5 ) + 1 ) - 1;
B = randi( 10 , randi( 5 ) + 1 , size( A , 2 ) ) - 1;

figure;
figA = gcf;
set( figA , 'NumberTitle' , 'off' , 'Name' , 'A' );
rowsA = size( A , 1 );
colsA = size( A , 2 );
xsA = linspace( 0 , 1 , colsA + 1 );
xsA = xsA( 1 : colsA );
ysA = linspace( 0 , 1 , rowsA + 1 );
ysA = ysA( 1 : rowsA );
ysA = fliplr( ysA );

for r = 1 : rowsA
    for c = 1 : colsA
        uicontrol( 'style' , 'text' , 'units' , 'normalized' , ...
            'position' , [ xsA( c ) ysA( r ) 1 / colsA 1 / rowsA ] , ...
            'string' , num2str( A( r , c ) ) , 'fontunits' , ...
            'normalized' , 'fontname' , 'fixedwidth' , 'fontsize' , 0.8 );
    end
end

figure;
figB = gcf;
set( figB , 'NumberTitle' , 'off' , 'Name' , 'B' );
rowsB = size( B , 1 );
colsB = size( B , 2 );
xsB = linspace( 0 , 1 , colsB + 1 );
xsB = xsB( 1 : colsB );
ysB = linspace( 0 , 1 , rowsB + 1 );
ysB = ysB( 1 : rowsB );
ysB = fliplr( ysB );

for r = 1 : rowsB
    for c = 1 : colsB
        uicontrol( 'style' , 'text' , 'units' , 'normalized' , ...
            'position' , [ xsB( c ) ysB( r ) 1 / colsB 1 / rowsB ] , ...
            'string' , num2str( B( r , c ) ) , 'fontunits' , ...
            'normalized' , 'fontname' , 'fixedwidth' , 'fontsize' , 0.8 );
    end
end

AB = AtimesB( A , B );
figure;
figAB = gcf;
set( figAB , 'NumberTitle' , 'off' , 'Name' , 'AB' );
rowsAB = size( AB , 1 );
colsAB = size( AB , 2 );
xsAB = linspace( 0 , 1 , colsAB + 1 );
xsAB = xsAB( 1 : colsAB );
ysAB = linspace( 0 , 1 , rowsAB + 1 );
ysAB = ysAB( 1 : rowsAB );
ysAB = fliplr( ysAB );

for r = 1 : rowsAB
    for c = 1 : colsAB
        uicontrol( 'style' , 'text' , 'units' , 'normalized' , ...
            'position' , [ xsAB( c ) ysAB( r ) 1 / colsAB 1 / rowsAB ] , ...
            'string' , num2str( AB( r , c ) ) , 'fontunits' , ...
            'normalized' , 'fontname' , 'fixedwidth' , 'fontsize' , 0.8 );
    end
end
