Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ToMatlab limitations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73564] Re: ToMatlab limitations
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 22 Feb 2007 04:26:34 -0500 (EST)
  • References: <erh8tk$4qn$1@smc.vnet.net>


Hi Will,

you may replace subscipted Variables by "concatenated" variables by the 

following rule:Subscript[x_, y_] :> Symbol[ToString[x] <> ToString[y]], 

(note the ":>" )

To change Greek characters into strings I only have an ugly solution to 

offer. Change the FullForm of your expression into a string, make the 

replacements and change back to an expression. Here is an example, 

packed into a function, but the same can as well be formulated as a rule:

gr2rom[x_] := Module[{s},

     s = ToString[FullForm[x]];

     s = StringReplace[s, RegularExpression["\\\\\[(\\w+)\\]"] -> "$1"];

     ToExpression[s]

     ]

Daniel



Will Robertson wrote:

> [It is the policy of this newsgroup and mailing list to

>  not discuss non-Mathematica systems, but since the ToMatlab

>  package is provided on the Wolfram Research site, I am permitting

>  it this time.  - Moderator]

> 

> 

> Hello,

> 

> I've stumbled across the ToMatlab package to extract some long

> equations derived in Mathematica to be used in an embedded controller

> via Matlab. It appeared to be the answer to all my problems, but I'm

> afraid it wasn't quite so handy as I initially thought.

> 

> Two questions to try and salvage the situation; sorry for my ignorance

> -- I'm a very new Mathematica user.

> 

> I've got a bunch of subscripted variables and I want to transform them

> into, well, "not subscripted" variables.

> For example, Subscript[x_, y_] -> xy.

> I'm embarrassed that even this simple task I can't complete. Obviously

> the variable "xy" doesn't match the x_ and y_, so I need instead a

> round-about way to get a concatentation of the two.

> 

> Secondly, I've also got a bunch of Greek variables. Is there an

> automatic way (that is, without enumerating them all in a

> ReplaceAll[]) to swap out the unicode character with their "name"?

> E.g., {\[alpha] -> alpha} for all the greek letters and variant greek

> letters?

> 

> (Oh how I wish Matlab would accept unicode characters for variable

> names.)

> 

> Many thanks in advance,

> Will Robertson

> 

> 




  • Prev by Date: Re: Limit of Error function Erf
  • Next by Date: Re: ToMatlab limitations
  • Previous by thread: Re: ToMatlab limitations
  • Next by thread: Re: ToMatlab limitations