Code covered by the BSD License  

Highlights from
Require FEX package

Require FEX package

by

 

16 Apr 2011 (Updated )

Let the user download and install those File Exchange packages, which your submission needs.

RequireFEXpackageExample2.m
% RequireFEXpackageExample2- script demonstrating how 
% the function 'requireFEXPackage' can be used to add (on demand) 
% other FEX submission on which your submission relies. 
% This example uses the ''try-catch'' command.
% 
% (C) Igor Podlubny, 2011

syms x
RosenbrockBananaFunction = @(x) (1-x(1)).^2+100*(x(2)-x(1).^2).^2;
try 
   % if function 'fminsearchbnd' already exists in your MATLAB
   % installation, just use it:
   x = fminsearchbnd(RosenbrockBananaFunction,[3 3])
catch 
   % if function 'fminsearchbnd' is not present in your MATLAB
   % installation, first get the package 8277 (to which it belongs) 
   % from the MATLAB Central File Exchange (FEX)
   P = requireFEXpackage(8277);  % fminsearchbnd is part of 8277
   % and then use that function:
   x = fminsearchbnd(RosenbrockBananaFunction,[3 3])
end



Contact us