该函数主要显示在神经网络工具箱中,相应的函数还有fixunknowns、mapstd、processpca等函数。 这个函数的说明文件中有这样一节
Before training, itisoftenusefultoscaletheinputsandtargetssothattheyalwaysfallwithinaspecifiedrange.thefunctionmapminmaxscalesinputsandtargettargetate e [1,1 ].thefollowingcodeillustrateshowtousethisfunction.[ pn,ps]=mapminmax(p([tn,ts]=mapminmax(t ) ) net=train(net,pn,tn ); theoriginalnetworkinputsandtargetsaregiveninthematricespandt.thenormalizedinputsandtargetspnandthatarereturnedwillallllfall ill 1 ].thestructurespsandtscontainthesettings,inthiscasetheminimumandmaximumvaluesoftheoriginalinputsandtargets.afterthenthenetettion thepssettingsshouldbeusedtotransformanyfutureinputsthatareappliedtothenetwork.theyeffectivelybecomeapartofthenetwork, justlikethenetworkweightsandbiases.ifmapminmaxisusedtoscalethetargets,theoutputofthenetworkwillbetrainedtoproduceoutputputputututpututs 1 ).toconverttheseoutputsbackintothesameunitsthatwereusedfortheoriginaltargets, usethesettingsts.thefollowingcodesimulatesthenetworkthatwastrainedinthepreviouscode,andthenconvertsthenetworkoutputbackintiode thenetworkoutputancorrespondstothenormalizedtargetstn.theunnormalizednetworkoutputaisinthesameunitsastheoriginaltargetst.iont hetrainingsetdata, thenwheneverthetrainednetworkisusedwithnewinputstheyshouldbepreprocessedwitheminimumandmaximumarecomputedforthetrainin PS.thefollowingcodeappliesanewsetofinputstothenetworkalreadytrained.pnewn=map minmax (anewn=sim (net,pnewn ) ); anew=mapminmax('reverse ',anewn,ts ); For most networks,including feedforwardnet,these steps are done automatically,sothatyouonlyneedtousethesimcommmand .在使用此函数时主要是ateps