%#function for feval

2 次查看(过去 30 天)
Fan Sudi
Fan Sudi 2012-4-2
function varargout = FMath(varargin)
if nargin == 0
OldHandle = findobj('Style','figure','Tag','FMath');
if ishandle(OldHandle)
close(OldHandle);
end
FMathHandle = figure ;
set(FMathHandle,'Tag','FMath','Units','pixel',... 'menubar','none','NumberTitle','off',...
'name','FMath计算器V 1.0','Resize','off',...
'Visible','off','Position',[50 100 397 500]);%1120 755 397
generate_figure(FMathHandle);
%movegui(FMathHandle,'center');
set(gcf,'Visible','on');
elseif ischar(varargin{1})%&~isnumeric(varargin{end})
try
if (nargout)
[varargout{1:nargout}] = feval(varargin{:});
else
feval(varargin{:});
end
catch
disp(lasterror);
end
end
%--------------------------------------------------------------------------
function generate_figure(FMathHandle)
Maybe I have many many callback functions so that it is may not to add that for each one.After All,varargin is only a invisibility function.Once I used it in Matlab6.5,there's no this problem.serval months ago,I used 6.5,everything is fine.
  1 个评论
Jan
Jan 2012-4-2
You forgot to mention the problem or ask a question.
Please format your code as explained in the "Markup help" link. Thanks!

请先登录,再进行评论。

回答(1 个)

Kaustubha Govind
Kaustubha Govind 2012-4-4
I think you are asking what you should do in a situation where the %#function pragma cannot be specified like in the example code you provided? You can simply add all the functions that could potentially called by FEVAL using the mcc -a option, or add all the relevant functions under "Additional/Other Files" if using deploytool. This is also mentioned as a workaround on Fixing Callback Problems: Missing Functions.

类别

Help CenterFile Exchange 中查找有关 Licensing on Cloud Platforms 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by