필터 지우기
필터 지우기

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?

답변 (1개)

Image Analyst
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)

카테고리

Help CenterFile 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!

Translated by