Filter löschen
Filter löschen

how to generate MEX from package function in MATLAB?

2 Ansichten (letzte 30 Tage)
Maurício Girardi-Schappo
Maurício Girardi-Schappo am 17 Mär. 2019
Beantwortet: David Fink am 19 Mär. 2019
I have the following directory structure:
main
+model
run.m
+options
opt.m
main.m
and so forth.
I have a function under `+model` directory called `run` that depends on some functions in the `+options` directory, such that my `main.m` script under directory `main` calls `model.run()` and the function `run` calls some `options.opt()`.
I want to generate a MEX file of `model.run()`, so I run the `coder` from MATLAB command prompt, and on the first screen, where I enter the function name to generate code for, I type
model.run
and the coder simply displays the error:
This file is shadowed by C:\....\main\+model\run.m
I already tried adding the `main` directory to the path, but it didn't work.
  • Is it even possible to compile a MEX for any package function, such as `model.run()` in this scenario?
MATLAB version: '9.4.0.813654 (R2018a)'
  1 Kommentar
Walter Roberson
Walter Roberson am 17 Mär. 2019
Perhaps if you create a new function that just calls model.run() and ask to generate code for the new function ?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

David Fink
David Fink am 19 Mär. 2019
Functions within packages are not supported as entry-point functions. (Current as of R2018b)
See the following question/answer with workarounds (including the one described by Walter on this question):

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by