function SRECT = SRECT(a,b) switch(nargin) case 1 SRECT = a*a; case 2 SRECT = a*b; otherwise disp('请输入矩形的长和宽数据!'); end