Time minimization transportation code

%{
This code gives overview part and contact for details,
Below code calls generatedata, printdata and mainscript functions,
generatedata generate random data,
printdata print data in respective forms,
mainscript performs calculations of proposed algorithms,
%}
%%%commonscript.m
clc;
clear all;
close all;
global printstr iterlimit
%inputdata; % to add fresh data
m=input('\nenter number of rows (m): ');
n=input('\nenter number of columns (n):');
printstr=[]; iterlimit=m*n*10;
printstr=sprintf('Problem start:\nGiven problem is for %d rows and %d columns\n',m,n);
[orig,Bl,ai,bj,L1,L2,lamda] = generatedata(m,n);
printdata;
tic;
%mainscript; %%% this method mainscript.m calls developed algorithm
fprintf('Our program ends here\n');
printstr=[printstr sprintf('Our program ends here\n')];
telapsed=toc; fprintf('%f\n',telapsed);
printstr=[printstr sprintf('%f\n',telapsed)];
fprintf('===================================\n');
printstr=[printstr sprintf('===================================\n')];
tic;
%othermethod; %this calls other methods
fprintf('\nOther program ends here\n');
printstr=[printstr sprintf('\nOther program ends here\n')];
telapsed=toc; fprintf('%f\n',telapsed);
printstr=[printstr sprintf('%f\n',telapsed)];
fprintf('===================================\n');
printstr=[printstr sprintf('\nEnd of problem\n***********\n\n')];
filechoice=input('Do you want to add solution to file (y or n): ','s');
if filechoice=='y'
    fid=fopen('tp_experiments_results.txt','a');
    fprintf(fid,'%s',printstr);
    fprintf('\ndata saved succesfully\n');
    fclose(fid);
end
fprintf('ASK FOR DETAILS OR DEVELOP CODE OF mainscript.m TO GET RESULTS\n');
fprintf('===================================\n');
%============End of commonscript.m==============%
%%% Below code is for generatedata.m
%This function generate data
function [orig,Bl,ai,bj,L1,L2,lamda] = generatedata(m,n)
    global printstr
    rg=[1,100];
    orig=randint(m,n,rg);
  
.
.
.

PREVIEW OF SMALL CODE AVAILABLE

...
..................

.........................

PLEASE ASK FOR DETAILS OF CODE WITH FULL ACADEMIC AFFILIATION

..............................................

................................................................

........................................................................

)];
for i=1:length(bj)
    fprintf('%d ',bj(i)); printstr=[printstr sprintf('%d ',bj(i))];
end
fprintf('\n'); printstr=[printstr sprintf('\n')];
fprintf('\n* is L1 position\n'); printstr=[printstr sprintf('\n* is L1 position\n')];
fprintf('Input sizes of L1=%d and L2=%d\n',length(L1(:,1)),length(L2(:,1)));
printstr=[printstr sprintf('Input sizes of L1=%d and L2=%d\n',length(L1(:,1)),length(L2(:,1)))];
%============End of printdata.m==============%
%%% Below code is for calculatelamda.m
%This function calculate value of lamda
function lamda=calculatelamda(lamda,m,n)
    s=length(lamda);
    lamda(s,1)=1;
    for k=1:s-1
        lamda(s-k,1)=(m+n-1)*lamda(s-k+1,1);
    end
end
%============End of function calculatelamda.m==============%