Jump to content

is it possible to Divide or Multiply all array entries at once?


Jordy

Recommended Posts

Hi,

I'm looking for a method to divide or multiply all entries in an array by the same number and store this into  another array.

[1,2,0,1,0,0,1.....] x 20 = [20,40,0,20,0,0,20,....]

Is there any way to do this without generating a loop.   (the MUL and DIV functions doesn't support an array as input.)

UDFB or c code?

Thanks

Link to comment
Share on other sites

  • MVP 2023

Depending on EXACTLY what math you want to do, the old Visilogic Linearize Array would do it.  I ran into this trying to convert a Visilogic program to UniLogic.  The following post addressed this problem, including an attached UDFB:

http://forum.unitronics.com/topic/6080-adventures-in-unistream-conversion-vect-linear/?tab=comments#comment-24545

Joe T. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.