Mathematica Goodstuff 
(P.Labossiere, 3-27-02)

First things first, here's how to turn off the spelling errors

Off[General::spell1];
Off[General::spell];

How to clear all unprotected variables

Clear["`*"]

How to discretize a plot and write data to a file for use in Excel

f[x_] = Sin[x];

Cos[ .5 Degree]

Plot[f[x], {x, 0, 2  π}];

data = 
      Table[{x, f[x]}, {x, 0. , 2.  π, 2.  π/100}]

Creating the file and write to it (comma delimited)

dumvar = 
        OpenWrite["datafile", 
          FormatType -> OutputForm];
\(Do[
	
      Write[dumvar, 
        data[[i, 1]], ",", 
        data[[i, 2]]]
, {i, 
        Length[t]}]\)
Close[dumvar];

Delete rows and/or columns from matrices

\(deleteColumn[matrix_, column_] := 
	
      Map[Delete[#, column] &, matrix]\)

\(deleteRow[matrix_, row_] := 
	
      Transpose[Map[Delete[#, row] &, Transpose[matrix]]]\)

list = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}

MatrixForm[list = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]

PaddedForm[TableForm[{6.7, 6.888, 6.99999}], {8, 5}]

deleteRow[list, 2] // MatrixForm

w = Table[5, {i, 3}, {j, 8}]
deleteColumn[w, 2]

Creating 2D plots (useful for shape functions)

n1[s_, t_] = (1/4) (s - 1) (t - 1);

Plot3D[n1[s1, s2], {s1, -1, 1}, {s2, -1, 1}, 
        Mesh -> True];

Plotting multiple curves with colour

Show[{Plot[Re[Sin[θ]], {θ, 0, 2 π}, 
            DisplayFunction ->  Identity, PlotStyle -> Hue[ .3]], 
          Plot[Re[Cos[θ]], {θ, 0, 2 π}, 
            DisplayFunction ->  Identity, PlotStyle -> Hue[ .7]], 
          Plot[Re[(E^(-θ))], {θ, 0, 2 π}, 
            DisplayFunction ->  Identity, PlotStyle -> Hue[ .0]]}, 
        DisplayFunction -> $DisplayFunction];

Integrate[D[Sin[x], x], {x, 0, 1. }]

sigmax = 2

sigmax

σ ϵ
√
3^2
(3^2)

3/4
(3/4) (10^6)

(3/4) (10^6) w