% Script/Function Filename:
%     CplusDGUI.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;

C = randi( 10 , randi( 5 ) + 1 , randi( 5 ) + 1 ) - 1;
D = randi( 10 , size( C , 2 ) , size( C , 1 ) ) - 1;

figure;
figC = gcf;
set( figC , 'NumberTitle' , 'off' , 'Name' , 'C' );
rowsC = size( C , 1 );
colsC = size( C , 2 );
xsC = linspace( 0 , 1 , colsC + 1 );
xsC = xsC( 1 : colsC );
ysC = linspace( 0 , 1 , rowsC + 1 );
ysC = ysC( 1 : rowsC );
ysC = fliplr( ysC );

for r = 1 : rowsC
    for c = 1 : colsC
        uicontrol( 'style' , 'text' , 'units' , 'normalized' , ...
            'position' , [ xsC( c ) ysC( r ) 1 / colsC 1 / rowsC ] , ...
            'string' , num2str( C( r , c ) ) , 'fontunits' , ...
            'normalized' , 'fontname' , 'fixedwidth' , 'fontsize' , 0.8 );
    end
end

figure;
figD = gcf;
set( figD , 'NumberTitle' , 'off' , 'Name' , 'D' );
rowsD = size( D , 1 );
colsD = size( D , 2 );
xsD = linspace( 0 , 1 , colsD + 1 );
xsD = xsD( 1 : colsD );
ysD = linspace( 0 , 1 , rowsD + 1 );
ysD = ysD( 1 : rowsD );
ysD = fliplr( ysD );

for r = 1 : rowsD
    for c = 1 : colsD
        uicontrol( 'style' , 'text' , 'units' , 'normalized' , ...
            'position' , [ xsD( c ) ysD( r ) 1 / colsD 1 / rowsD ] , ...
            'string' , num2str( D( r , c ) ) , 'fontunits' , ...
            'normalized' , 'fontname' , 'fixedwidth' , 'fontsize' , 0.8 );
    end
end

CD = CplusD( C , D );
figure;
figCD = gcf;
set( figCD , 'NumberTitle' , 'off' , 'Name' , 'AB' );
rowsCD = size( CD , 1 );
colsCD = size( CD , 2 );
xsCD = linspace( 0 , 1 , colsCD + 1 );
xsCD = xsCD( 1 : colsCD );
ysCD = linspace( 0 , 1 , rowsCD + 1 );
ysCD = ysCD( 1 : rowsCD );
ysCD = fliplr( ysCD );

for r = 1 : rowsCD
    for c = 1 : colsCD
        uicontrol( 'style' , 'text' , 'units' , 'normalized' , ...
            'position' , [ xsCD( c ) ysCD( r ) 1 / colsCD 1 / rowsCD ] , ...
            'string' , num2str( CD( r , c ) ) , 'fontunits' , ...
            'normalized' , 'fontname' , 'fixedwidth' , 'fontsize' , 0.8 );
    end
end
