How can we do it bu function call?
Ältere Kommentare anzeigen
M=input('Enter number of manufacturers');
D=input('Enter number of distributers');
O=1;
T=1;
R=1;
Z=1;
Cmd=zeros(M:D);
for m=1:M;
for d=1:D;
Cmd(m,d)=input('Enter traveling cost for manufacturer to distributer');
disp(Cmd);
end
end
SumCmd=sum(Cmd(:));
disp(SumCmd);
3 Kommentare
Walter Roberson
am 23 Feb. 2017
What part is to be done as a function call? What are the expected inputs to the function? What are the expected outputs of the function?
Aimen Mujahid
am 23 Feb. 2017
Bearbeitet: Aimen Mujahid
am 23 Feb. 2017
Jan
am 23 Feb. 2017
I assume you want Cmd=zeros(M, D) instead of Cmd=zeros(M:D).
Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!