n=input('Enter the number of targets'); s=input('Enter the number of sensors'); l=input('Enter the lifetime of sensors'); setcover=0; a=randi(n,s,1) g= cell(1,s); for i=1:s s(i)=a(i); g=randperm(n,s(i)); end. How to stoge the values of g for
Ältere Kommentare anzeigen
n=input('Enter the number of targets'); s=input('Enter the number of sensors'); l=input('Enter the lifetime of sensors'); a=randi(n,s,1) g= cell(1,s); for i=1:s s(i)=a(i); g=randperm(n,s(i)); end.
How to store the values of g for each loop? I want the values of g of each loop. if i run like this only the last loop value is alone stored?
1 Kommentar
Stephen23
am 17 Dez. 2014
Antworten (1)
Thorsten
am 17 Dez. 2014
g(i) = randperm(n,s(i));
Kategorien
Mehr zu Energy Production 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!