LabVIEW

cancel
Showing results for 
Search instead 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! 

0 Kudos
Message 1 of 8
(2,912 Views)

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)

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

 

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

Best regards,
GerdW


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

Hi,

 

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

 

Just in case multiplication is too trivial. Smiley Wink

Best regards,
GerdW


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

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

 

squares.png

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

Message Edited by Cory K on 06-22-2009 07:12 PM
Cory K
0 Kudos
Message 5 of 8
(2,882 Views)
If thats too hard try easy.PNGOr, since you have a 2d arrayeasy-nd.PNG
Message Edited by Jeff Bohrer on 06-22-2009 08:52 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 8
(2,872 Views)
Cory, that's R-G!  see below the expression node is polymorphic in 7.1 isn't it?

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

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)