Robert Dailey wrote: > Hi, > > I have two questions: > > 1) Is there any way to represent vectors? Currently I'm using 'array' for > vectors. >
I suppose you mean vectors in the Matlab way? Then you should have a look at http://scipy.org/NumPy_for_Matlab_Users#head-e9a492daa18afcd86e84e07cd2824a9b1b651935 In short: of course you can do all linalg with numpy.array. With numpy.matrix, some operations (like dot products) can be written more conveniently. > 2) Is there a way to calculate the magnitude (length) of a vector? > a = array([3,1,4]) len(a) a.size # only for a rank-1 array a.shape[0] For some basics on numpy, you may also check out: http://scipy.org/Documentation HTH -- cheers, steve I love deadlines. I like the whooshing sound they make as they fly by. -- Douglas Adams ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users