|
From: | Michael Creel |
Subject: | Re: round() in oct file? |
Date: | Mon, 12 Feb 2007 10:25:48 +0100 |
User-agent: | Thunderbird 1.5.0.9 (X11/20070103) |
John W. Eaton wrote:
On 12-Feb-2007, Michael Creel wrote:| Well, I'd like to element-by-element round all values in a matrix, without | looping. Since the octave matrix class is involved, I think that this might be | the place to ask. Thanks, though. MichaelI think something like the following should work. Matrix m1 = ...; m1.apply (xround); // Changes values in m1. Matrix m2 = m1.map (xround); // Creates new matrix m2 with rounded vaues. The xround function is declared/defined in lo-mappers.{h,cc}. jwe
Thanks. Looping at the matrix class, I saw the map "method" (or whatever the correct term is). I was suspecting that it could be used. If I get it to work I'll add it to the quick reference.
M.
[Prev in Thread] | Current Thread | [Next in Thread] |