userchange.m
来自「有关matlab的电子书籍有一定的帮助希望有用」· M 代码 · 共 37 行
M
37 行
function UserChange(obj)
%UserChange Method for FD meas object
% Author: T. Krauss
% Copyright (c) 1988-98 by The MathWorks, Inc.
% $Revision: 1.2 $
obj = struct(obj);
objud = get(obj.h,'userdata');
switch get(obj.h,'style')
case 'edit'
str = get(obj.h,'string');
[val,errstr] = fdutil('fdvalidstr',str,objud.complex,objud.integer,...
objud.range,objud.inclusive);
if isempty(errstr)
objud.lastvalue = objud.value;
objud.value = val;
set(obj.h,'userdata',objud)
set(obj.h,'string',fdutil('formattedstring',obj))
if ~isempty(objud.callback)
cb_error = 0;
evalin('base',objud.callback,'cb_error = 1;')
if cb_error
errstr = sprintf('Error in evaluating callback:\n%s',lasterr);
msgbox(errstr,'Error','error','modal')
end
end
else
msgbox(errstr,'Error','error','modal')
set(obj.h,'string',fdutil('formattedstring',obj))
end
otherwise
warning('No support for this style of measurement object yet')
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?