matlab中 S函数 显示没有定义变量t是怎么回事
2个回答
展开全部
>> help varargin
VARARGIN Variable length input argument list.
Allows any number of arguments to a function. The variable
VARARGIN is a cell array containing the optional arguments to the
function. VARARGIN must be declared as the last input argument
and collects all the inputs from that point onwards. In the
declaration, VARARGIN must be lowercase (i.e., varargin).
For example, the function,
function myplot(x,varargin)
plot(x,varargin)
collects all the inputs starting with the second input into the
variable "varargin". MYPLOT uses the comma-separated list syntax
varargin to pass the optional parameters to plot. The call,
myplot(sin(0:.1:1),'color',[.5 .7 .3],'linestyle',':')
results in varargin being a 1-by-4 cell array containing the
values 'color', [.5 .7 .3], 'linestyle', and ':'.
See also varargout, nargin, nargout, inputname, function, lists, paren.
Reference page in Help browser
doc varargin
VARARGIN Variable length input argument list.
Allows any number of arguments to a function. The variable
VARARGIN is a cell array containing the optional arguments to the
function. VARARGIN must be declared as the last input argument
and collects all the inputs from that point onwards. In the
declaration, VARARGIN must be lowercase (i.e., varargin).
For example, the function,
function myplot(x,varargin)
plot(x,varargin)
collects all the inputs starting with the second input into the
variable "varargin". MYPLOT uses the comma-separated list syntax
varargin to pass the optional parameters to plot. The call,
myplot(sin(0:.1:1),'color',[.5 .7 .3],'linestyle',':')
results in varargin being a 1-by-4 cell array containing the
values 'color', [.5 .7 .3], 'linestyle', and ':'.
See also varargout, nargin, nargout, inputname, function, lists, paren.
Reference page in Help browser
doc varargin
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询