ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array

Hi everbody,

 

I have a array. for example,

index 0 is 20 (element)

index 1 is 10

....

index 10 is 30

 

I would like to shift index of the array and add a new number to index 0 and 12. for example,

index 0 is new number (0)

index 1 is 20

index 2 is 10

....

index 11 is 30

index 12 new number(100)

 

How can I do it?

Thank you.

 

 

0 Kudos
Message 1 of 4
(3,101 Views)

Use "build array" with three inputs. Middle for array and Top/bottom for the new elements.

 

 

0 Kudos
Message 2 of 4
(3,097 Views)

Rotate Array followed by a Replace Array Subset should do it.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(3,070 Views)

@crossrulz wrote:

Rotate Array followed by a Replace Array Subset should do it.


That would keep the array the same size. The way I understood, the new array should be larger by two elements.

0 Kudos
Message 4 of 4
(3,047 Views)