How to map the values from 0-320 to 0-29
    조회 수: 2 (최근 30일)
  
       이전 댓글 표시
    
Hi, I want to map values using matlab, but I don't know,How to do it. I want to map 0-320 to 0-29.There are many such mappings which I want to, Please tell me how to do it. Thanks
댓글 수: 2
  per isakson
      
      
 2016년 11월 16일
				
      편집: per isakson
      
      
 2016년 11월 16일
  
			Something like this?
>> map = @(x) 0 + ((29-0)/(320-0)).*x;
>> map(0)
ans =
     0
>> map(320)
ans =
    29
>> map(0:80:320)
ans =
         0    7.2500   14.5000   21.7500   29.0000
답변 (1개)
  Massimo Zanetti
      
 2016년 11월 16일
        Just multiply your values by 29/320;
k = 29/320;
%generate some random numbers between 0 and 320
x = 320*rand(5);
%map them to [0,29]
y = k*x
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



