denormalization of a data

4 次查看(过去 30 天)
mukesh kumar
mukesh kumar 2018-3-29
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.

回答(1 个)

Star Strider
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 ]

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by