Effacer les filtres
Effacer les filtres

This is matlab parallel server quesion

18 vues (au cours des 30 derniers jours)
멋진남자
멋진남자 le 14 Sep 2023
Modifié(e) : 멋진남자 le 22 Août 2024 à 7:02
This is matlab parallel server quesion
  1 commentaire
Walter Roberson
Walter Roberson le 14 Sep 2023
My speculation is that the final argument would be the location to assign the output result to.

Connectez-vous pour commenter.

Réponses (1)

Matan Silver
Matan Silver le 14 Sep 2023
Hello,
Walter is correct: If you are generating code for a MATLAB function with an output, there are some scenarios in which that will become a "pass by reference" argument that represents the output of the function.
For struct arguments (which it does not look like applies in this case), you can use the PassStructByReference config parameter to influence this behavior for both entrypoint inputs and outputs: https://www.mathworks.com/help/coder/ug/pass-structure-arguments-by-reference-or-value.html#PassStructureArgumentsByReferenceOrByValueExample-5.
The "coder::array" means that particular input (or output) is a dynamically allocated array. To see more information about how to use "coder::array", you can see this doc page:
The page above also contains an example showing how you can pass a result argument by reference to store the output of the entrypoint.
There are a number of things you can do to influence the generation of dynamically allocated arrays. You could generate C instead of C++, in which case we will generate "emxArray"-style variable sized arrays: https://www.mathworks.com/help/coder/ug/use-c-arrays-in-the-generated-function-interfaces.html. You can also generate "coder::array"-style dynamically allocated arrays with C++ using the DynamicMemoryAllocationInterface parameter on the config: https://www.mathworks.com/help/coder/ref/coder.codeconfig.html#mw_3fc64d5b-5aa4-4a11-bf6b-10e138b71948. Other factors like whether the array is fixed or variable sized, if it has an upper bound on the size, etc., can change the representation of the array in generated code.
Feel free to reply if you have any further questions!
Matan

Catégories

En savoir plus sur Generating Code dans Help Center et File Exchange

Tags

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by