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: 

Array Interpolation

Solved!
Go to solution

hello!I have an array ,Assuming it has 100 values,it's Arbitrary, I want to insert values:

After two each in the array values to insert a value, such as 0 ,This has been the cycle continues until the end, Then get a new array,how should I do ??

Spoiler
 
0 Kudos
Message 1 of 8
(3,039 Views)

Seems like a very simple problem. What have you tried so far?

0 Kudos
Message 2 of 8
(3,019 Views)

Hi dfaweew,

 You can insert those values into an array if you can make use of "Insert into Array" vi .

 Please find the attached solution.

 

Regards.

SrikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 3 of 8
(3,018 Views)

srikrishnaNF wrote:

 Please find the attached solution.


Please don't attach "solutions" until you have tested them. You code makes absolutely no logical sense. Ever heard about shift registers?

0 Kudos
Message 4 of 8
(3,009 Views)
Solution
Accepted by topic author dfaweew

@dfaweew wrote:

hello!I have an array ,Assuming it has 100 values,it's Arbitrary, I want to insert values:

After two each in the array values to insert a value, such as 0 ,This has been the cycle continues until the end, Then get a new array,how should I do ??


 As a first step you need to describe the problem much more accurately.

 

If you have an array with 100 elements, do you (1) want to replace every third element with zero, keeping the array size constant, or do you  (2) want to insert extra elements, making the final array 50% larger?

 

Here's a simple draft for case (2).

 

 

0 Kudos
Message 5 of 8
(2,999 Views)

Hi dfaweew,

 I am so sorry as i have posted a wrong solution...I just posted another screenshot of block diagram.

 Hope this helps you..

 

 

Regards,

SrikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 6 of 8
(2,985 Views)

srikrishnaNF wrote:

 I am so sorry as i have posted a wrong solution...I just posted another screenshot of block diagram.

 Hope this helps you..


 You are doing this way too complicated! It also looks very inefficient with the repeated array resizing operations.

Now try to do the same with 10% of the code!

 

(also please attach the actual VI instead of pictures. we cannot run pictures)

0 Kudos
Message 7 of 8
(2,978 Views)

thank you,i got it!

Spoiler
Smiley Happy

 

0 Kudos
Message 8 of 8
(2,962 Views)