谁给解释下MATLAB这句话的意思.如下

来源:百度知道 编辑:UC知道 时间:2024/05/25 08:32:56
function [] = pb_call(varargin)
% Callback for pushbutton
S = varargin{3}; % Get the structure.
N = str2double(get(S.ed(1:2),'string')); % The numbers to operate on.
VL = get(S.pp,{'str','value'}); % User's choice of operation.

% Now get the string updates and perform operations.
switch VL{1}{VL{2}} % User's string choice from popup.
尤其是那个S = varargin{3};

varargin是代表输入的变数量参数(输入参数个数可以任意),但必须作为最后一个参数出现,它是一个cell型数据

function [] = pb_call(varargin)
% Callback for pushbutton
S = varargin{3}; % 取第三个输入参数,从下面的语句可以看出,第三个参数,是个GUI中的handles结构体
N = str2double(get(S.ed(1:2),'string')); % 获取对应ed控件的字符串
VL = get(S.pp,{'str','value'}); % 获取tag为pp的控件的字符串和值

% Now get the string updates and perform operations.
switch VL{1}{VL{2}} % 这个语句没有写完,是用来判断选择的

% by dynamic of Matlab技术论坛
% see also http://www.matlabsky.com
% contact me matlabsky@gmail.com
% 2009-08-16 13:49:33

varargin()
传递一个参数中变量的数目给函数