How to deal with name/value pairs of function arguments in MATLAB

后端 未结 14 1098
忘掉有多难
忘掉有多难 2020-11-28 19:28

I have a function that takes optional arguments as name/value pairs.

function example(varargin)
% Lots of set up stuff
vargs = varargin;
nargs = length(vargs         


        
14条回答
  •  囚心锁ツ
    2020-11-28 19:37

    Read Loren's informative post on this issue. Don't forget to read the comments section... - You will see that there are quite a few different approaches to this topic. They all work, so selecting a prefered method is really a matter of personal taste and maintainability.

提交回复
热议问题