Generation of rundon numbers with different scales

2 Ansichten (letzte 30 Tage)
Luis Paniagua
Luis Paniagua am 5 Nov. 2019
Beantwortet: the cyclist am 5 Nov. 2019
Hello!
I got a vector which is
M= [3.452, 3.235, 5.453, 0.0000045, 0.0000065]
and I want to generate a vector of random values that I can add to M, i.e. every value of the vector has to be about the same orther than the original value.
How could I do that?
Thank you so much

Antworten (1)

the cyclist
the cyclist am 5 Nov. 2019
You aren't very specific, but the following will generate random values scaled by the value in M.
r = 0.1*M.*randn(size(M))

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by