sym to fortran: matrix index
Show older comments
Hello
'fortran' tranlates all number in sym expression to Fortran double precision number (e.g. 1.0D0) even for array index. I can not find a way to declare a matrix with symbolic dimensions in Matlab, so I declare them as functions. For example:
syms i integer
syms x(i)
fortran(x(i-1))
returns
ans =
' t0 = xx(ii-1.0D0)'
which is rather unconvenient. Is there any way to circumvent this problem?
Thank you.
Carlos SPAIN
Answers (0)
Categories
Find more on Fortran with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!