Listing the input arguments and values of a function in a Matrix
1 次查看(过去 30 天)
显示 更早的评论
Is there a way to list the input arguments in a function by outputting them in a Cell array
[input1 = x; input2 = y; input3 =z; ..etc]
I have a large function with about 20 inputs and want to check on them all before I proceed.
0 个评论
采纳的回答
Fangjun Jiang
2011-6-28
Yes, you can. Use this example:
InputArgument={'this is the string for the pattern','pattern'}
strfind(InputArgument{:});
3 个评论
更多回答(1 个)
Stuart Layton
2011-6-28
William, i'm thinking you want to use varargin. By defining the input arguments as varargin you can have as many input arguments as you want. Parsing this is pretty easy too, its simply a cell array of the arguments. Look at using the InputParser to parse it.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Argument Definitions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!