13.07.2015 Views

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

Mathematica Tutorial: Notebooks And Documents - Wolfram Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

70 <strong>Notebooks</strong> and <strong>Documents</strong>String-Oriented Output Formats"text"a string containing arbitrary textText strings.The quotes are not included in standard <strong>Mathematica</strong> output form.In[1]:= "This is a string."Out[1]= This is a string.In input form, the quotes are included.In[2]:= InputForm@%DOut[2]//InputForm= "This is a string."You can put any kind of text into a <strong>Mathematica</strong> string. This includes non-English characters, aswell as newlines and other control information. "Strings and Characters" discusses in moredetail how strings work.StringForm@"cccc``cccc",x 1 ,x 2 ,…DStringForm@"cccc`i`cccc",x 1 ,x 2 ,…Doutput a string in which successive `` are replaced bysuccessive x ioutput a string in which each ` i ` is replaced by thecorresponding x iUsing format strings.In many situations, you may want to generate output using a string as a “template”, but“splicing” in various <strong>Mathematica</strong> expressions. You can do this using StringForm.In[3]:=This generates output with each successive `` replaced by an expression.StringForm@"x = ``, y = ``", 3, H1 + uL^2DOut[3]= x = 3, y = H1 + uL 2You can use numbers to pick out expressions in any order.In[4]:= StringForm@"8`1`, `2`, `1`

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!