%#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 Center および File ExchangeLicensing on Cloud Platforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by