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: 

Indexing out, rearranging array of clusters to show 3d surface

I have a the attached 3d array of clusters. The cluster contains 3 elements: intensity, time, voltage.
I want to rearrange this so as to be able to show on a 3d surface graph, for each X,Y coordinate, the voltage surface (Z-axis) as a function of Intensity (X-axis) and time (Y-axis). It is not clear to me how to accomplish the indexing on this so as to be able to do this.

I believed this to be a trivial problem and I might have brainlock this afternoon but I need another
set of eyes to look at this. The successful solution to this problem should result in a set of voltage surfaces as a function of intensity (grey level) and time for each X,Y location.

We know the X-axis (Intensity) for the
3d surface graph will be 10, 55, 100 (that never changes).
Message 1 of 33
(3,532 Views)
There is something twisted here : a kind of 6D data structure : each element of the 3D array (XYZ) contain the XYZ coordinates.
I need a refund for 1 kg acetylsalicilic acid.

Could you explain how your data structure was generated, or even better, post the corresponding vi, after removing all irrelevant parts ?
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 2 of 33
(3,521 Views)
The CW 3d chart wants four arrays of 1-d each.

The attached code (LV 7.1) builds these arrays and plots the same.

I am not sure what your data set should look like so this is as far as I can go.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 3 of 33
(3,521 Views)
It is not clear to me the role of the w-vector for the CW 3d chart. But the x-vector should be Intensity, y-vector should be time, and Z-vector should be voltage.

But remember EACH (X-location,Y-loction) point of the array should have a voltage surface as a function intensity (x-vector) and time (y-vector). So the end result should be an array of voltage surfaces the total number of which is equal to the number of x-locations times the number of y-locations.
0 Kudos
Message 4 of 33
(3,521 Views)
Hi Chilly:

How the structure is generated will not help us here. Consider that we have the existing array of clusters and this is what we need to work with.
0 Kudos
Message 5 of 33
(3,521 Views)
Hi Don,

With your last statement it sounds more to me that you are looking at a 2D array of voltages (if your have continuous X and Y values) or a 1D array of clusters of voltage, X and Y (if the data is non-continuous).

For the first case, look at the shipping example called �3D Surface Example - Fluctuating Sine Wave.vi�. Notice that the 2D array is wired to the �z matrix� input of the �3D Surface.vi�.

Is this far from what you are expecting?

Best regards,
Philip C.
Applications Engineer
National Instruments
www.ni.com/ask
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 6 of 33
(3,519 Views)
Please see the attached. A voltage curve or surface (z-vector) as a function of intensity (x-vector) and time (y-vector) is what I need AT EACH X,Y LOCATION. If you study my array of clusters closely, you will see that for each x,y location, if you change the intensity, there will be a new time value and a new voltage value. Therefore, at the 3 intensity levels (x-vector), there will be a time series (Y-vector) and a voltage vector (z-vector). The issue here is, given the array of cluster information that I have shown you, how do I easily within the labview coding environment index the voltage surface AT EACH X,Y location? The example I am attaching shows how to do this for location X = 0, Y = 0. But given any number of X,Y locations (say I have a
200 x 200 matrix of X,Y locations), what would the code look like to index out the information without having to construct 200 x 200 'If X = ... and Y = ...' to extract out the specific vectors at those locations? (And then plot on one plot to form a true voltage surface?)

Thanks,

Don
0 Kudos
Message 7 of 33
(3,519 Views)
Still trying to understand what you want to obtain (already 2 kg acetylsalicilic acid).
For a given pixel location, and for 3 intensity values I, you have a corresponding time T and voltage values V. That defines 3 points in the ITV space, and you can draw a plane (triangular piece of) through these 3 points.
Now, for another pixel, you will get another plane triangle, with the same I values, that as little reasons to share an edge with the previous one. That means that you will not be able to construct a surface from the association of the different triangles that you get at each pixel location (as evidenced with your vi when you set the case to true).
Therefore, I suppose that what you want to do is to visualize separately each pl
ane triangle at each pixel location.
Attached is an example of what you could do, using a 2D index to choose the pixel coordinates. By the way, I used here another possible representation of your data, as an intensy graph, where the cursor is used to generate the 2D index.

Hope this helps...

Due to technical problemes, I have to separate the vi as main + 2 subs.
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 8 of 33
(3,519 Views)
Here are the subs...
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Download All
0 Kudos
Message 9 of 33
(3,519 Views)
Hi chilly charly:

I cannot read your code (I am on win pc and have winzip and winrar which will not open the .sit files) but I think you have cracked what I am trying to do. I want to calculate the series of 3d 'curves' at each X,Y location to finally comprise a 3d surface. My initial thought was to run two for loops around the whole structure and index out the data all X and Y locations as shown in the attached. This should I thought result at the least in the series of 'curves', albeit some duplicative curves that would just overlay one another. But so far have not gotten it to work.

I'm sorry you are getting heartburn! Me too. Mostly I have been working on other things and come back to this when I have a moment with new
idea.

Sincerely,

Don
0 Kudos
Message 10 of 33
(3,371 Views)