matlab program for getting results of all inputs sets in one column
Afficher commentaires plus anciens
Hello,
i want to run given below program for n set of inputs. example of input sets-
set 1. f= 7, c0= 1, r0= 3
set 2. f= 9, c0= 2, r0= 4
Every input set will generate 5*5 output matrix as t=5
Then how can i get actual output in column in command window as- For example,
output = output for input set1(matrix of 5*5)
output for input set2(matrix of 5*5)
.
.
output for input set n(matrix of 5*5)
function poster
t= 5;
f = input ('Enter d0 :');
c0= input ('Enter c0 :');
r0 = input ('Enter r0 :');
t=t-1;
M = zeros(t);
for k = 1:f
p = randperm(t);
for s = 1:t
M(p(s),s) = M(p(s),s) + 1;
end
end
M = [M(:,1:c0-1),zeros(t,1),M(:,c0:t)];
M = [M(1:r0-1,:);zeros(1,t+1);M(r0:t,:)];
M(1:(t+2):(t+1)*(t+1))= 0;
disp(M);
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Random Number Generation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!