help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with octave


From: Moo
Subject: Re: help with octave
Date: Wed, 14 Jul 2010 20:36:08 +0200

 
2,please send an example on how to evaluate a series using loop- not getting loop- eg, 1^2 +2^2+ 3^2 . . . 100^2.
 

Yet another way to do any sum of squares like this is:

v = 1:100;
result = v*v'

Which, like pathematica said, is the square of the norm of the vector v, or doing the dot product of v with itself.  Again, this only works for sum-of-squares.  But if you already have the terms of -any- series in a vector U (for example), you can just use sum(U) to sum up the elements of the vector.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]