looking for a function similar to mapminmax

8 ビュー (過去 30 日間)
Respaco
Respaco 2014 年 2 月 27 日
回答済み: Greg Heath 2014 年 3 月 16 日
Hi,
As far as I know mapminmax Map matrix row minimum and maximum values to [-1 1].What I am looking for is that I want the data to be transformed into the interval [0,1].
For instance after using artificial neural network, I have gained the following vector for my response: r= 0.36293 46.949 136.57 1159
But the original example has written its output in something like :
r= 0.28 0.58 0.16 0.29
How can I change my data to be able to compare my result with that one?
Thank in advance for your comments

採用された回答

Greg Heath
Greg Heath 2014 年 3 月 6 日
編集済み: Greg Heath 2014 年 3 月 6 日
1. Convert targets to closed interval [0, 1]
2. Use LOGSIG for the output transfer function
Thank you for formally accepting my answer
Greg

その他の回答 (3 件)

Greg Heath
Greg Heath 2014 年 3 月 16 日
minA = min(A(:))
maxA = max(A(:))
(B- minB)/(maxB-minB) = (A-minA)/(maxA-minA)
B = minB +(maxB-minB)*(A-minA)/(maxA-minA)
Hope this helps
Greg

Jos (10584)
Jos (10584) 2014 年 2 月 27 日
A = ceil(10*rand(4,4)) % example data
A = A - min(A(:)) % map minimum value of A to 0 (thereby changing the maximum)
A = A ./ max(A(:)) % scale between 0 and 1

Respaco
Respaco 2014 年 2 月 27 日
Thanks, but in this way my minimum changes to zero. You know preferably the data are between zero and one. Anything for that?
  3 件のコメント
Respaco
Respaco 2014 年 2 月 27 日
Yes you are right I did. Now I'd like to change the variables ,x such that to 0<x<1
Jos (10584)
Jos (10584) 2014 年 2 月 27 日
How exactly? What is the relation between the input and output?
Input = [1 2 3]
Output = ... ??? % but all values between 0 and 1

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by