Is there an example that shows how to use mxArray API functions in a Fortran MEX-file in MATLAB?

2 views (last 30 days)
I am trying to write a Fortran MEX-file, and I want to use mxArray API functions to construct the left hand side output argument "plhs(0)". However, I am receiving a segmentation violation. I would like to know if there are any restrictions with using "plhs".

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
"plhs" is a pointer to an array of mxArrays. By default it has a NULL value. In order to perform any operations on "plhs", it must be initialized. See the attached example below ("mextest.F") for an example of first initializing the output, and then performing assignment statements and operations.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!