Converting Matlab ode45 into C with complex output
Afficher commentaires plus anciens
I tried using the Matlab coder tool in order to export my ode solver to C (hoping that I might get a run-time boost).
Since I am solving a Schrodinger equation my output should be a complex vector.
When I'm running my regular Matlab code, everything works just fine, but when the coder tool runs the check of the mex file, it returns an error - "the output data must be real when enforcing non-negativity...".
I couldn't find a place where it is stated that the Matlab coder can only convert ode45 with real input/output.
If it's not obvious, I didn't request the output to be real. I also tried defining both the input and the output as complex, and it didn't help.
Any suggestions?
Réponses (1)
Torsten
le 20 Nov 2017
0 votes
"the output data must be real when enforcing non-negativity...".
But you seem to use the non-negativity option of ODE45 which doesn't make sense for complex output.
Best wishes
Torsten.
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!