LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dublicates elements of an array

Solved!
Go to solution

Dear friends,

As new user of lab view, I am struggling with this challenge

it would be very difficult for me to explain it and I try to make it clear by an example

array :         2 3 4 5

iteration:      3 2 1 2

out put:       2 2 2 3 3 4 55

my VI is only working for the first element

 

0 Kudos
Message 1 of 16
(4,124 Views)

Step back, write down on a piece of paper how you do this.  Think in terms of loops and iterations.

Some useful functions would initialize array, and also using concatenating tunnels on loops.

 

Insert into Array should not be used at all in your solution.

0 Kudos
Message 2 of 16
(4,120 Views)

I have done all you told me, it seems the solution of this challenge is beyond my knowledge and I have spent more than 5 hours to solve it.

I am not that kind of guy to ask too instead of trying.

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

Is this a class assignment?

0 Kudos
Message 4 of 16
(4,098 Views)

of course NO

0 Kudos
Message 5 of 16
(4,094 Views)

Okay then.

 

It had the smell of homework, and we don't want to do people's homework for them.

 

Still, you'll learn more if you can figure it out yourself.

I'll give you some tips.  It is a simple VI and I'll tell you exactly what elements you need in there.

1.  2 controls that are your 2 1-D arrays for the inputs

2.  1 indicator that is your 1-D array output.

3.  1 For Loop

4.  1 Initialize Array

5.  Auto-index input tunnels

6.  Concatenating output tunnel.

 

That is all you need.

 

Message 6 of 16
(4,088 Views)

Looping.png

 

Try this. hope two many of your post with similar requirments

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 16
(4,075 Views)

@PalanivelThiruvenkadam wrote:

Looping.png

 

Try this. hope two many of your post with similar requirments


Note: A 2D array is symmetrical, so regardless of the Iteration array, the result will be a X by Y matrix where Y is the biggest of Iteration array. The "shorter" rows will be padded. If you want an array of differently long arrays, you'll need to create an array of clusters, including a 1D array.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 16
(4,068 Views)

Hope the array elements has to iterate based on Iteration elements (value) so obvious that the input should be same array size for both Array as well as iteration.

correct me if i am wrong?

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 9 of 16
(4,066 Views)

Yamaeda,

 

That is a concatenating output tunnel.  It will not create a 2-D array.

 

Here is the simplest implementation.

 

 

Message 10 of 16
(4,029 Views)