denormalization of a data
조회 수: 2 (최근 30일)
이전 댓글 표시
I had a matrix A=[2063 2003 1992 2004 2070 2246 2678 3083 3161 3160 3176 3130 3038 3047 29852930 3069 3228 3087 2929 2790 26022404 2205]; and I want to create a matrix B data range 150-300 that is like this that at the peak of A there will be minimum of B and at the min of A there will be peak of B in the same ratio select the other data reverse like this.
댓글 수: 0
답변 (1개)
Star Strider
2018년 3월 29일
Try this:
A = [2063 2003 1992 2004 2070 2246 2678 3083 3161 3160 3176 3130 3038 3047 29852930 3069 3228 3087 2929 2790 26022404 2205];
[As,Ix] = sort(A);
B = linspace(300, 150, numel(A));
B(Ix) = B;
A = [ 2063 2003 1992 2004 2070 2246 2678 3083 3161 3160 3176 3130 3038 3047 29852930 3069 3228 3087 2929 2790 26022404 2205 ]
B = [ 279 293 300 286 271 257 250 207 179 186 171 193 229 221 150 214 164 200 236 243 157 264 ]
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!