Some sample programs and manipulations in Mathematica. * Mathematica files have .nb extensions, and are actually just text. * It's a full programming language. For example, to create a program to print a table of squares, doSquares[n_] := Block[{}, Do[ Print[ "i=", i, " and its sqaure is ", i^2 ], {i,1,n} ]; Print["So there."]; ]; Notes: The ":=" assignment operator means "evaluate later." The "n_" variable matches any atomic thingy that's passed in. (f[n]:= ... would only match "f[n]", not "f[2]". Then typing "doSquares[10]" runs the program. * Directory[] and SetDirectory["/home/mahoney"] are "pwd" and "cd". * pic = Import["file.jpeg"] will read an image into a Graphics Raster object. * to get the actual numbers out, use data = pic[[1,1]] * To see it as a matrix or a picture on the screen, try MatrixForm[data] or data // MatrixForm or ListDensityPlot[data] or data // ListDensityPlot * To create an 8x8 DFT matrix, n=8; dft = Table[ Cos[Pi/n j (k+1/2)], {j,0,n-1}, {k,0,n-1}]; dft // MatrixForm //N The "N" there is "Numerical", as opposed to symbolic. * To create a vector v = {1,1,1,1,1,1,1,1}; or v = Table[i, {i,1,8}]; or v = someMatrix[[All,1]]; * To multiply a matrix and a vector dft . v * To apply the DFT to both rows and columns dft=N[dft]; so we don't carry around the symbolic form, then dft . Transpose[ dft . v ] and then use //Round//N or //Round//ListDensityPlot to view it.