From: Hans F. <H.F...@so...> - 2003-08-20 13:45:06
|
Hi Aaron, > > I am sure Python is the better language to learn programming (and > > there are extensions such as VPython, GnuPlot, Scientific, Numeric etc > > which allow you to do pretty much the same stuff as you can in MATLAB.) > > However, we would need to know more precisely what you want to teach. > > I'm leaning toward using Python at this point just because students who > have exposure to it in the physics course <snip> Great - go for it. > Out of curiosity, do any of the modules you mentioned (Scientific, > Numeric, or VPython) have matrix objects, operations, and functions > defined? Oh yes. Numeric as all based around matrix operations (and these are coded in C so they are fast). Scientific I mentioned, because you can plot x-y graphs pretty much as you can in MATLAB. (I actually meant scipy.) Please find below an example for matrix operations and for plotting. If you use Linux, then you have more choice with respect to using other tools (xmgrace). You might also want to look at mayavi to visualise 2d and 3d data from within python. Best regards, Hans Example: #----------------------------------- # # showing how to use Numeric and scipy to imitate MATLAB behaviour # import scipy.gplt as plt import Numeric, math N = 100 a = Numeric.arange(0,3*math.pi,1.0/N) b = Numeric.sin(a) #note this is a matrix operation plt.plot(a,b) plt.ytitle('sin(x)') plt.title('The big title (using Gnuplot as rendering engine)') #----------------------------------- |