You can call MATLAB® functions, operators, user-defined
functions, and other binary MEX files from within your Fortran source
code by using the API function
sincall.F example creates an
passes various pointers to a local function to acquire data, and calls
calculate the sine function and plot the results. To see the source
the file in MATLAB Editor.
sincall calls to fill the
the file in MATLAB Editor.)
It is possible to use
any other API routine) from within your computational Fortran subroutine.
You can only call most MATLAB functions with double-precision
data. Some functions that perform computations, such as the
do not work correctly with data that is not double precision.
To build this example, at the command prompt type:
mex sincall.F fill.F
Running this example:
displays the results:
You can generate an object of type
See the following example.
This function returns two variables but only assigns one of them a value:
function [a,b]=foo[c] a=2*c;
If you then call
the unassigned output variable is now of type