# LabVIEW

cancel
Showing results for
Did you mean:

## take the square of array elements - labview 7.1

Hello,

I am using labview version 7.1 and apparently it doesnot have square function in the numeric pallete. I have to take the square of each elements of a 2-D array and create a new array. i was wondering if anyone knows how to do this in the version I am using.

Thanks!

Message 1 of 8
(2,912 Views)

## Re: take the square of array elements - labview 7.1

Uh, what's wrong with the multiply function?

Message Edited by Dennis Knutson on 06-22-2009 03:37 PM
Message 2 of 8
(2,906 Views)

## Re: take the square of array elements - labview 7.1

First you give them (electronic) calculators and now they don't know about simple math

Sorry labview_dummy, but this comes to my mind when reading your question...

Best regards,
GerdW

using LV2020 on Win8.1+cRIO
Message 3 of 8
(2,896 Views)

## Re: take the square of array elements - labview 7.1

Hi,

one more suggestion: x^2=exp(2*ln(x))

Just in case multiplication is too trivial.

Best regards,
GerdW

using LV2020 on Win8.1+cRIO
Message 4 of 8
(2,892 Views)

## Re: take the square of array elements - labview 7.1

And just to show how to implement Dennis's code with your application:

Just wanted to take a pre-emptive strike against Rube Goldberg code

Message Edited by Cory K on 06-22-2009 07:12 PM
Cory K
Message 5 of 8
(2,882 Views)

## Re: take the square of array elements - labview 7.1

If thats too hard try Or, since you have a 2d array
Message Edited by Jeff Bohrer on 06-22-2009 08:52 PM

"Should be" isn't "Is" -Jay
Message 6 of 8
(2,872 Views)

## Re: take the square of array elements - labview 7.1

Cory, that's R-G!  see below the expression node is polymorphic in 7.1 isn't it?

"Should be" isn't "Is" -Jay
Message 7 of 8
(2,869 Views)

## Re: take the square of array elements - labview 7.1

Jeff Bohrer wrote:
Cory, that's R-G!  see below the expression node is polymorphic in 7.1 isn't it?

You're right! I forgot you could pass an array to a numeric operator.
Isn't LabVIEW great. Even when you think you made simple code, it can get even simpler.
Cory K
Message 8 of 8
(2,857 Views)