LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plot multiple 3d

Hello,

I am trying to draw 3D plots in the same graph and I need the z matrix from the xyz. Does anyone know how to to it. I found in the forum a way but unfortunately it requires integers for the each z values because they are used as index.

http://forums.ni.com/t5/LabVIEW/XYZ-coordinates-to-matrices/m-p/2511834#M764343

 

I tryed to make the VI and the conversion to the Z matrix is missing.

Could you please help me to complete it?

Cheers,

Zied

0 Kudos
Message 1 of 22
(6,306 Views)

Your 2D array "X intial" is already z-matrix.
I've  added z-shift into your code and theere is result

3dplots2.png

 

3dplots.png

Message 2 of 22
(6,283 Views)

Thank you Artem.

The Xi is a 2D array that contains the values of the xi and yi and I have a 1D array that contains the zi for the each (xi,yi).

I should mention that the values of the xi or yi or zi are not incrementing and are not integers to use them as indices.

Cheers,

Zied

0 Kudos
Message 3 of 22
(6,244 Views)

I think you not understand principles of drawing.
You should prepare 2D array of z values. Each element of array mean "high" of corresponding point.
If you want different step on x and y you need x and y arrays.
In this case each point in x array mean x-coordinate of corresponding row of z-array.
each point in y array mean y-coordinate of corresponding column of z-array.

 

3d.png

 

3d-2.png

Message 4 of 22
(6,220 Views)

Thanks Artem. What you said is exactly what I have ( the zi value for each (xi,yi). They in 3 separate 1D array. My question is how to merge them together to get 2D array. Should I use the matrix builder or the interpolation function of the array?

Sorry, but \i am still confused.

Thanks,

Zied

0 Kudos
Message 5 of 22
(6,216 Views)

How you imagine convert 1D to 2D?
You only can use the same value for whole row (array2) or column (array3).

 

1d2d.png

Message 6 of 22
(6,199 Views)

I am really sorry but your answer makes me more confused.

All what I need is to convert my 3 1D arrays to a 2D arrays that I can use in my VI to mege several 3D plots together.

The problem is that (xi,yi) that corresponds to zi(xi,yi) is not an integer.

For example, when z=6.5, x=9.42 and y=-20.2

the next value of z=1.23 corresponds to x=12.12 and y=5.09....

Thanks,

Zied

0 Kudos
Message 7 of 22
(6,172 Views)

Zied
I used DBL elements, where you see integers?

If you need draw line, may be better use 3d line graph?

 

3dline.png

Message 8 of 22
(6,159 Views)

And what is the best way to add these lines to a ready 3D scatter plot?

My life will be easy if I can find a solution to convert the 3 1D array to the 2D array for the z matrix that can be undertood by the 3D surface vi of labview.

Cheers,

Zied

0 Kudos
Message 9 of 22
(6,154 Views)

Why you can't use 3d curve VI?

Message 10 of 22
(6,147 Views)