| Author |
Comment/Response |
ndrs
|
04/28/10 09:54am
Using Optimize[] from Optimize.m I get a list of equations which look like
newoptimizationvariable -> oldexpression
I want to use these results in Matlab, so I use CForm[]. But of course this creates something like
Rule(newoptimisationvariable, oldexpression)
So i want to replace "->" with "=".
Using StringReplace doesnt work right. When i use StringReplace with a variable of my expression like
opt = Optimize[expression]
StringReplace[opt, "->" -> "="]
Mathematica complains, that there is no string in Position 1.
So I tried to copy&paste the optimized expression into
StringReplace["paste_here", "->" -> "="]
This seemed to work right, but when i then use
CForm[] it results in some weird expressions with lots of slashes inside like
o48 = \!\(1\/12\)
instead of
o48 = 1/12
URL: , |
|