LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do this nested loop inside labview

Solved!
Go to solution

i2d=[]
img=[]
for j in range(0,129600,360):
    i2d=[]
    for i in range(j,360+j):
      i2d.append(data[0][i])
    img.append(i2d)

0 Kudos
Message 1 of 6
(267 Views)

You can easily put a loop inside of a loop.  You could probably do all of the appending of arrays by simply using autoindexing terminals.


GCentral
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
Message 2 of 6
(262 Views)

there is a 1Darray of length 129600 and I want to create a 2D array of 360x360 out of it 

I'm new to Labview and confused to do it

 

i2d=[]
img=[]
for j in range(0,129600,360):
    i2d=[]
    for i in range(j,360+j):
      i2d.append(data[i])
    img.append(i2d)

 

 

0 Kudos
Message 3 of 6
(253 Views)

1.png

 

I tried but was not able to do so can you provide screenshots 

I'm confused how to append to array that RED BOX 

 

means I am unable to change default array ([0]) with appended array 

I'm new to this

 

 

0 Kudos
Message 4 of 6
(256 Views)
Solution
Accepted by topic author gptshubham595

Something like this?

 

Frozen_0-1610564621064.png

 

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
Message 5 of 6
(246 Views)

Just wire from one tunnel to the next.  It will go from a 1D array to a 2D array.


GCentral
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
Message 6 of 6
(232 Views)