How to manipulate the vector prob5 = rand(1,6) to create a new vector of values that range from 10 through 20?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How to manipulate the vector prob5=rand(1,6) to create a new vector of values that range from 10 through 20?
0 Kommentare
Antworten (1)
Image Analyst
am 25 Nov. 2015
it's just very simple algebra:
prob5=rand(1,6)
minp = min(prob5)
maxp = max(prob5)
out = 10 + 10 * (prob5 - minp) / (maxp-minp)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interpolation of 2-D Selections in 3-D Grids 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!