| Author |
Comment/Response |
feng
|
09/05/07 01:26am
I have some expressions like “rho[1,2]*Sqrt[5]”
I want to output it into a txt file in the format of fortran.
I just use “FortranForm[rho[1,2]*Sqrt[5]”, it returns “rho(1,2)*Sqrt(5)”
Here “Sqrt(5)” in fortran returns an erro, it should be “Sqrt(5.0)” , but mathematica just gives “Sqrt(5)”
I don’t want to use “N[ ]”, because I have the index 1 and 2 which should be remains integer, just as follows
N[rho[1,2]*Sqrt[5]]
=>rho(1.,2.)*Sqrt(5.)
How should I do?
Many thanks
URL: , |
|