04-12-2023 12:20 PM
I have 1D array and I want to scan its element, manipulate them accordingly and create a new array with modified values. I came up with this but it only replaces one value at a time instead of replacing them all. If my index is 0, I only replaces first value, when index is 1, it replaces only second. Obvious solution is to perform this outside of for loop and but I can't bring index outside of the loop, it say it different values type. Other than converting indexing variable i and performing subset replacement outside of the loop, is there a simpler solution? Thanks
04-12-2023 12:41 PM
What you wanted to achieve not able to get exactly your problem, Just Let us know your inputs and expected output value
04-12-2023 12:49 PM - edited 04-12-2023 12:52 PM
I want my output to be an array with first value "XY" and second "RZ". I'm simplifying, there's a much longer command that I want to append to "X" and "R", so it makes sense to use for loop.
I'd have several strings/variables "A", "B", "C", "D", etc. and I want to get an array with "A4321", "B4710", "C7310", etc.
04-12-2023 01:08 PM
If your input is Array you can use this method.
04-12-2023 03:24 PM
@John32d wrote:
I want my output to be an array with first value "XY" and second "RZ". I'm simplifying, there's a much longer command that I want to append to "X" and "R", so it makes sense to use for loop.
I'd have several strings/variables "A", "B", "C", "D", etc. and I want to get an array with "A4321", "B4710", "C7310", etc.
The first step of solving a problem is define it. You have not (yet). And no, you code picture above make absolutely no sense.
So you have an array with two elements [XY, RZ] and want to add more elements to that.
LabVIEW does not have variables. Where do the strings (A, B, C, D) come from? Are these scalars? Are these in an array of ordered elements? Where do the number come from? (4321, 4710, 7310, etc)
What should the final array size be? Do you know that size from the beginning?