Julia has some special characters it recognizes inside string. For example, `$` lets you interpolate Julia variables or expressions inside a string. To get a string that represents what you've literally typed in, you need to add a backslash before the backslash and dollar sign characters. The backslash will not be present when you print the strings out or otherwise use them, although it will appear when Julia shows the value to you at the REPL.
~~~ julia> "3.2 3.6 z(x,y) = x@~\\327@~exp(-x@+2@+-y@+2@+)" "3.2 3.6 z(x,y) = x@~\\327@~exp(-x@+2@+-y@+2@+)" julia> print(ans) 3.2 3.6 z(x,y) = x@~\327@~exp(-x@+2@+-y@+2@+) julia> "grdmath \$ DDX" "grdmath \$ DDX" julia> print(ans) grdmath $ DDX ~~~ -- Leah On Sun, Sep 6, 2015 at 4:08 PM, J Luis <[email protected]> wrote: > I need to create these, not to interpret what julia thinks it means. > > julia> "3.2 3.6 z(x,y) = x@~\327@~exp(-x@+2@+-y@+2@+)" > ERROR: syntax: invalid UTF-8 sequence > > julia> "grdmath $ DDX" > ERROR: syntax: invalid interpolation syntax: "$ " > > How do I do that? > > Thanks >
