LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace elements in array

Solved!
Go to solution

Seems like a possible solution, but how to set the limits for a 2D array?

0 Kudos
Message 11 of 19
(2,302 Views)

I would just put the In Range function inside the same For Loop as the interval calculation and just ditch negative values.

 

TimeIntervalBounded.png

Message 12 of 19
(2,299 Views)

I don't have some of your subVIs. Let's make it simple:

 

  1. Add an indicator after the transpose operation (see image)
  2. run the VI so the indicator contains data
  3. change the indicator to a constant, still containing the data.
  4. delete the code to the left of it, including the transpose operation.
  5. save VI under a new name and attach.

Message 13 of 19
(2,294 Views)

Hoping it will work now.

0 Kudos
Message 14 of 19
(2,291 Views)
Solution
Accepted by topic author Sjefsgjogleren

What of you would just do it in the inner loop?

 

 

Download All
Message 15 of 19
(2,274 Views)

Worked fined, but I had to increment the number of loop iterations by 1, in order not to cut of the last row of the array! Seems like it is working fine now! Thanks a lot for the help!:D

 

Greetings

Kristoffer

0 Kudos
Message 16 of 19
(2,268 Views)

I was just wondering if I could bother you with one last question. I have added some code, in order to interpolate between some datapoints, and then multiplying this with the transposed array that you just helped me with. I then want to find the total sum for each column, but when I do this I end up with an 1D array of only 60 elements. I guess it should have been something like 180 elements (one element for each column). Do you have any idea of where this come from?

 

Greetings

Kristoffer

0 Kudos
Message 17 of 19
(2,260 Views)

Well, most of your code is overly complicated and a lot of it makes no sense. For example your inner FOR loop on the right repeats the same calculation 200x. Once is enough!

 

Here's a quick draft, also simplifying the interpolation. If you want to sum in the other dimension, just remove the transpose operation as indicated.

Message 18 of 19
(2,247 Views)

Thank you so much! You are truley a master of LabView!:)

 

Greetings

Kristoffer

Message 19 of 19
(2,230 Views)