03-16-2016 12:02 PM
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
03-16-2016 03:17 PM
Your 2D array "X intial" is already z-matrix.
I've added z-shift into your code and theere is result
03-17-2016 05:08 AM
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
03-17-2016 12:50 PM
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.
03-17-2016 01:19 PM
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
03-17-2016 02:12 PM
How you imagine convert 1D to 2D?
You only can use the same value for whole row (array2) or column (array3).
03-18-2016 08:51 AM
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
03-18-2016 11:23 AM
Zied
I used DBL elements, where you see integers?
If you need draw line, may be better use 3d line graph?
03-18-2016 12:15 PM
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
03-18-2016 01:47 PM
Why you can't use 3d curve VI?