%#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