[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: index precision issues
From: |
Joan Picanyol i Puig |
Subject: |
Re: index precision issues |
Date: |
Wed, 27 Apr 2005 00:34:19 +0200 |
User-agent: |
Mutt/1.5.6i |
* Hall, Benjamin <address@hidden> [20050426 20:29]:
> How about using round to force octave to recognize your step size as an
> integer, e.g.:
>
> >>> lsnapshots = ps (:, 1:round(model.dts / model.dt):__end__)
I want to protect myself from this (although I'm aware that fractional
oversampling factors are common).
> When I try to use selected samples from my long vector I get:
>
> error: expecting integer index, found 1001.000000
> error: in /usr/home/joan/wd/simulacions--mainline--0.6--current/rx_signal.m
> near line 33, column 20:
>
> >>> lsnapshots = ps (:, 1:model.dts / model.dt:__end__)
What is wrong in this indexing approach?
>
> keyboard: stopped in
> /usr/home/joan/wd/simulacions--mainline--0.6--current/one_drop.m at line 33
> debug> disp(size(ps))
> 3 1000000
> debug> disp(model.dts/model.dt)
> 1000.0
This is unexplainable to me: octave complains about 1001.000000 not
being and integer index, but tells me that that value was 1000.0
instead?
tks
--
pica
-------------------------------------------------------------
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
-------------------------------------------------------------