How to manipulate the vector prob5 = rand(1,6) to create a new vector of values that range from 10 through 20?
3 ビュー (過去 30 日間)
古いコメントを表示
How to manipulate the vector prob5=rand(1,6) to create a new vector of values that range from 10 through 20?
0 件のコメント
回答 (1 件)
Image Analyst
2015 年 11 月 25 日
it's just very simple algebra:
prob5=rand(1,6)
minp = min(prob5)
maxp = max(prob5)
out = 10 + 10 * (prob5 - minp) / (maxp-minp)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interpolation of 2-D Selections in 3-D Grids についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!