04-20-2009 02:34 PM
Hello, everyone,
I am trying to parse an array only for all its odd/even number elements.
I am thinking of use Mod function upon 'iteration' but labview seems have
nothing there.
Does anyone know something about that?
Thanks in advance,
-Kunsheng
Solved! Go to Solution.
04-20-2009 02:46 PM
04-20-2009 02:46 PM
05-31-2012 10:15 AM
The "Sign" function in the Numeric palette returns a "-1" for a negative number and a "1" for a positive number. If you multiply your non-zero number by the outcome of this function, your number is returned positive and this becomes essentially a Mod[number] function.
05-31-2012 10:36 AM
@stu Turner wrote:
The "Sign" function in the Numeric palette returns a "-1" for a negative number and a "1" for a positive number. If you multiply your non-zero number by the outcome of this function, your number is returned positive and this becomes essentially a Mod[number] function.
No, that is ABS(number). MOD needs 2 inputs: the number and what the base is. For instance MOD(3,2) is 1. The easiest way to think of MOD is the remainder when you divide two numbers.
05-31-2012 11:03 AM
I found my way to this page because I was looking for a modulus function in the mathematical sense, i.e. In mathematics, the absolute value (or modulus) | a | of a real number is the numerical value of a without regard to its sign.
05-31-2012 11:10 AM
@stu Turner wrote:
I found my way to this page because I was looking for a modulus function in the mathematical sense, i.e. In mathematics, the absolute value (or modulus) | a | of a real number is the numerical value of a without regard to its sign.
Interesting. I never heard absolute value be called modulus before. I just hit wikipedia to check. In every sense I've heard of modulus (including a few math and cryptography classes), it is remainder (http://en.wikipedia.org/wiki/Modular_arithmetic).
05-31-2012 11:26 AM
I don't doubt your knowledge in this area, I was just defending my corner.
http://en.wikipedia.org/wiki/Absolute_value
05-31-2012 11:31 AM - edited 05-31-2012 11:34 AM
@Kunsheng Chen wrote:
Hello, everyone,
I am trying to parse an array only for all its odd/even number elements.
I am thinking of use Mod function upon 'iteration' but labview seems have
Save yourself the looping, why not just use decimate 1 D array?
Edit: Misread, you want the even/odd elements, not even odd indices.
05-31-2012 11:57 AM
@crossrulz wrote:
@stu Turner wrote:
I found my way to this page because I was looking for a modulus function in the mathematical sense, i.e. In mathematics, the absolute value (or modulus) | a | of a real number is the numerical value of a without regard to its sign.
Interesting. I never heard absolute value be called modulus before. I just hit wikipedia to check. In every sense I've heard of modulus (including a few math and cryptography classes), it is remainder (http://en.wikipedia.org/wiki/Modular_arithmetic).
That's because technically it's modulo, not modulus. Pesky mathematicians.