Why is the inputParser method addParamValue not recommended and how does it differ from addParameter?

1 回表示 (過去 30 日間)
Marshall
Marshall 2015 年 1 月 27 日
回答済み: Adam 2016 年 8 月 25 日
Basically the question above..
I've been using the inputParser class for a little while and mostly use addParamValue for name/value pairs. I've just upgraded to 2014b. I can't seem to see much of a difference between addParamValue and addParameter.
Is it simply the addition of matchPriorityValue input argument? If so, why couldn't that just be appended to addParamValue in some future release?
  1 件のコメント
guoqiang qiu
guoqiang qiu 2016 年 8 月 25 日
I have met the same problem. My Matlab version is 2012b, however, I cannot find addParameter function anymore. I am not sure whether addParamVaule can replace addParameter?

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

回答 (1 件)

Adam
Adam 2016 年 8 月 25 日
addParameterValue is a function from R2007b, addParameter was added in R2013b clearly with the intention of replacing it.
So addParameter will do mostly the same and should always be used if you have the relevant version of the software. If you don't then continue to use the older version. That it is 'not recommended' presumably just means there is now a newer version of the function that is more stable and being actively supported whereas I imagine addParameterValue is no longer being supported so, for example, will not undergo any performance improvements.

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by