% Assignment 2.
% Start by defining the function properties,
% returns values of 'mat_sum' and 'mat_dim'
% takes a variable called 'file' as a parameter.
% catching returned values is done exactly as
% written here in the definition:
% [a b] = JKO_01_02('some_file.mat');

function [mat_sum, mat_dim] = JKO_01_02(file)

load (file);    % load contents of file

subplot(2, 1, 1); bar(sum(X, 1)); % column sums of X
subplot(2, 1, 2); bar(sum(X, 2)); % row sums of X

mat_sum = sum(sum(X)); % sum of all elements in X
mat_dim = size(X);     % dimensions of X