help-octave
[Top][All Lists]
Advanced

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

Re: Invalid index error


From: Geraint Paul Bevan
Subject: Re: Invalid index error
Date: Mon, 02 Aug 2004 00:46:00 +0100
User-agent: Mozilla Thunderbird 0.5 (X11/20040306)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rich Shepard wrote:

| Geraint,
|
|   Perhaps my manual edition is out of date. I read on page 177:
|
| prod (x)  # There's only a single parameter, you used two parameters.
|
| "... For a matrix argument, return the product of the elements in each
| _column_ as a row vector."
|
|   I need the products of each row.
|
|   Also, I need to calculate the 6th root (since there are 6 elements
in each
| row) of that product, then normalize the elements by dividing them by that
| root. I used **-6 because I do not find a function to extract the nth root
| of a value. Is this the proper way?
|
| Thanks,
|
| Rich
|

Perhaps you still have the manual from 2.1.35 installed? If you type
'help prod' it should tell you about the second argument which sets the
dimension. Even if the second argument didn't exist, you could achieve
the same result with "prod(a')", where ' is the transpose operator.

To get the sixth root, you should use the ^ operator:

octave:1> 729^(1/6)
ans = 3

- --
Geraint Bevan
http://homepage.ntlworld.com/geraint.bevan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iEYEARECAAYFAkENgLgACgkQcXV3N50QmNOjVQCfQMsJ0x08yl0rk19WS3rsHOR3
uyMAn014z4nfUO/hU4qQU3CqYOpVZHVZ
=WSD3
-----END PGP SIGNATURE-----



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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