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!