Effacer les filtres
Effacer les filtres

How can I convert power operator of Matlab (^) to (**) to be used in Fortran?

1 vue (au cours des 30 derniers jours)
ND
ND le 13 Mai 2015
Commenté : Star Strider le 13 Mai 2015
Please I am using Matlab to calculate a jacobian matrix then I need to transfer this matrix to fortran. the problem is Matlab uses the power operator as(^) while fortran uses (**). I try to convert this operator by using (strrep function) after calculating the jacobian matrix. However, Matlab gives me this error message. (convert to double from syms is not possible).
Please there is such a way to solve this problem?
Best regards & many thanks

Réponse acceptée

Star Strider
Star Strider le 13 Mai 2015
Don’t do it yourself! If you want to convert a symbolic expression to FORTRAN, use the fortran function. It will do the conversion for you.
  2 commentaires
ND
ND le 13 Mai 2015
Many thanks for your comment, it really solves the problem.
Best regards
Star Strider
Star Strider le 13 Mai 2015
My pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Fortran with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by