How to index something based on numbering order???
Mostra commenti meno recenti
Hi everyone
I am not that much professional in Matlab and I have a vector of x= 94*1 containig 7 different integer numbers (1 to 7). I want to generate another vector Y= 94*7 of random numbers between 0 and 1 and put them as a vector based on the number in the x vector. I will explain how...
for example if the first number in the vector x is 2, okay, that means the first row in the generated vector Y should be [0.02 0.82 0.0025 0.03, 0.0027, 0.0025 0.0015] the most imprtant thing is the all generated numbers should be between 0 and 1, and the max number should be located in the place of the number in the vector x.
this id the input: x = [2; 3; 7; 5; 1]
the expected output is: Y =
0.0200 0.8200 0.0025 0.0300 0.0027 0.0025 0.0015
0.0024 0.0035 0.7600 0.0080 0.0500 0.0014 0.0020
0.0200 0.0025 0.0300 0.0027 0.0250 0.0015 0.8900
0.0024 0.0035 0.0080 0.0500 0.8400 0.0020 0.0027
0.9120 0.0002 0.0050 0.0258 0.0020 0.0010 0.0000
Thanks in advance
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!