Typecast to an int in Octave/Matlab

Posted by Leif Andersen on Stack Overflow See other posts from Stack Overflow or by Leif Andersen
Published on 2010-03-31T22:06:22Z Indexed on 2010/03/31 22:23 UTC
Read the original article Hit count: 484

Filed under:
|
|
|
|

I need to call the index of a matrix made using the linspace command, and based on somde data taken from an oscilloscope. Because of this, the data inputed is a double. However, I can't really call:

Time[V0Found]

where V0Found is something like 5.2 however, taking index 5 is close enough, so I need to drop the decimal. I used this equation to drop the decimal:

V0FoundDec = V0Found - mod(V0Found,1)
Time[V0FoundDec]

However, eve though that drops the decimal, octave still complains about it.

So, what can I do to typecast it to an int?

Thank you.

© Stack Overflow or respective owner

Related posts about octave

Related posts about matlab