FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Evaluating MATLAB functions from Mosel

Description
Evaluate a MATLAB function from Mosel:
  • fibonacci.m: an implementation of the Fibonacci function in MATLAB
  • fib_relay.mos: calling the MATLAB 'fibonacci' function from Mosel

fibonaccim.zip[download all files]

Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
fibonacci.m[download]
fib_relay.mos[download]





fibonacci.m

%*******************************************************
%  Mosel Matlab Example Problems
%  =============================
%
%  file fibonacci.m
%  ``````````````````
%  Fibonacci function for the fib_relay.mos program
%
% (c) 2014 Fair Isaac Corporation
%     author: L.Bertacco, Apr. 2014
%*******************************************************

function f=fibonacci(n)   
  if n<2, f=n; return, end
  s=[0 1];
  for i=2:n, s=[s(2) sum(s)]; end  
  f=s(2);
end
Back to examples browserPrevious exampleNext example