From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to create a 1 D array with the "build array VI"? when receiving random number

Hello all,

 

Is it possible to create a 1 D array with the "build array VI" when receiving random number?

 

I am receiving random data and the build array VI always create a 2D array which might cause some problem if you want to compute certain type of operation after.

 

Any example will be welcomed.

 

Thank you,

 

Israel 

0 Kudos
Message 1 of 16
(3,053 Views)

Build Array (technically it is called a "primitive," not a VI) generates an array at the output which has one more dimension than the inputs. So it sounds like at least one of your inputs is already a 1D array.

 

Please post your code so we can see what is happening.

 

Lynn

Message 2 of 16
(3,050 Views)

r-click the Build array and select Concatenate input.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 3 of 16
(3,047 Views)

Hello Lynn and Yamaeda

 

First I want to Thank you Lynn for your linguistic contribution indeed "Build Array" is a primitive and not VI, thank you for the education. In reality what I am doing is simple.

 

I have two arrays of complex elements Array1 and Array2.

 

Array1 conains the complex elements ""(a0+ib0) ; (a1+ib1) ;...(an+ibn) ;

 

Array2 conains the complex elements ""(c0+id0) ; (c1+id1) ;...(cn+idn) 

 

What I want to do is the multiplication of the first array by the  conjugate of the second array element.

Array1*(Conjugate Array 2)" for the first element the results is "(a0.C0-b0.d0) + i(b0c0-a0d0)" and the etc...

 

and then taking the square root ([(a0.C0-b0.d0) power of 2]) +  [(b0c0-a0d0) power of 2])

 

I was wondering if there were some dedicate primitive that could solve the computation above which is the cross correlation in Frequency domain.

 

Thank you very much.

Israel

 

0 Kudos
Message 4 of 16
(3,006 Views)

The functions on the Numeric palette are polymorphic. That means that they will accept multiple datatypes. For your case you benefit twice. The work on complex numbers and arrays of complex numbers. The Complex subpalette of the Numeric palette has a Complex Conjugate function.  RMS.vi is in Mathematics >> Probability & Statistics palette. 

 

I did work though the math manually to see if the answers are correct for the arbitrary values I chose.

 

Lynn

 

Complex.png

0 Kudos
Message 5 of 16
(2,992 Views)

Is this useful?

math.JPG 

Đặng Huy Hoàng
Message 6 of 16
(2,969 Views)

@Hohohihijj wrote:

Is this useful? 


Don't overcomplicate things! You are using way too much code. Everything in the red box could be replaced by a single "absolute value" function. Try it!

 

 

 

(I think there are further simplifications possible....)

 

Also, why are you using CXT and EXT? CDB and DBL are sufficient in most scenarios.

Message 7 of 16
(2,958 Views)

Thanks a lot.Smiley Very Happy

Đặng Huy Hoàng
0 Kudos
Message 8 of 16
(2,934 Views)

Hello Guys,

 

Your help is amazing, but I will do, If I want to do the following operation (a*a+b*b) power 0.75 or other value. Thank you to all you.

 

Israel

0 Kudos
Message 9 of 16
(2,912 Views)

@israel.haifa wrote:

Hello Guys,

 

Your help is amazing, but I will do, If I want to do the following operation (a*a+b*b) power 0.75 or other value. Thank you to all you.

 

Israel


Square and Power of X should do it, no?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 16
(2,887 Views)