%#function for feval

2 views (last 30 days)
Fan Sudi
Fan Sudi on 2 Apr 2012
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 Comment
Jan
Jan on 2 Apr 2012
You forgot to mention the problem or ask a question.
Please format your code as explained in the "Markup help" link. Thanks!

Sign in to comment.

Answers (1)

Kaustubha Govind
Kaustubha Govind on 4 Apr 2012
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.

Categories

Find more on Licensing on Cloud Platforms in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!