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: 

2D array Intensity Graph into 2D array of 3 columns

Solved!
Go to solution

Dear All,

 

I made Intensity Graph from number of X-Y curves. And I want to get the data in X,Y,Z form.

I checked the data from intensity graph is 2D array. While, I plan to get in form of X,Y,Z.

the picture is as following (just for illustration).

 

abuzahra_0-1625215464141.png

 

I have no idea how to change into 3 columns X,Y,Z.

is it possible?

Could you advise me some possible solution for this matters?

I really appreciate for all advice.

 

Thank you

 

0 Kudos
Message 1 of 6
(2,355 Views)

The values of the intensity graph are Z while X and Y are the array indices (Possibly scaled by offset and multiplier of the axes).

 

It seems trivial to iterate over the 2D array of intensities and form each row of the output based on the indices. What have you tried?

0 Kudos
Message 2 of 6
(2,310 Views)

If I understand the problem correctly, here is one possible solution.

 

(Since you only showed a picture, I'm only attaching a picture too. We typically prefer example VIs.)

 

It would be trivial to change the linear scaling of the x and y axes if needed, or swap their order in the output array. You could even conditionally skip all rows where Z=0, etc.

 

altenbach_0-1625236298715.png

 

 

(The outer output tunnel mode is concatenating. Are you familiar with that?)

0 Kudos
Message 3 of 6
(2,307 Views)

Dear Altenbach,

 

Thank you for your helpful advice.

you understood correctly the problem.

I am sorry for not uploading the VIs previously since the file is quite complex.

But you really gave good way.

 

What I had done before is by using for loop like you did, but it was only single for loop and used the auto-indexing instead of concatenating tunnel. so I made one outer for loop and one inner for loop and use the concatenating tunnel in the end.

 

I tried your advice by using simple X- and Y-array replacing the i element for both loop.

I haven't tried yet in the real data yet, but it seems it is going to work.

But please let me know if you have some advice/correction.

here attached the VIs.

 

0 Kudos
Message 4 of 6
(2,286 Views)
Solution
Accepted by topic author abuzahra

No, You did not implement anything correctly.

 

Your version is obviously wrong and makes no sense.

 

Your "implementation" that you falsely label as "my version" is also incorrect. The X and Y arrays need to autoindex on different loops. Y on the outer loop (and the Y array need to match the number of rows), X on the inner loop (and the X array needs to match the number of columns).

 

altenbach_0-1625295225670.png

 

And please don't maximize the front panel and diagram to the monitor. That's very annoying!

 

Message 5 of 6
(2,280 Views)

I see. I misunderstood.

 

Ok, noted. Y on the outer loop and X on the inner loop.

And please don't maximize the front panel and diagram to the monitor. That's very annoying!

    >> I am sorry for that. I will be more careful next time.

 

Thank you for your help

I appreciate it.

 

0 Kudos
Message 6 of 6
(2,139 Views)