How to create discrete variable??
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Triveni
am 17 Dez. 2015
Kommentiert: Triveni
am 17 Dez. 2015
I have to create discrete matrix
A(:,:,k) = [a b c d e f g h i j k l m n o p];
for k= 1:N
i want to allocate a b c... from matrix [0 10 20 30 40] only. How can i allocate randomly a b c...
please help me
0 Kommentare
Akzeptierte Antwort
Guillaume
am 17 Dez. 2015
I'm not entirely clear on what you're asking. This may do what you want:
valuepool = [0 10 20 30 40];
N = 2;
randidx = randi(numel(valuepool), [16 16 N]);
A = valuepool(randidx)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!