11-04-2022 08:48 AM
Hi all,
I've been trying to use a VI referenced by @chrisjfrye in this thread https://forums.ni.com/t5/LabVIEW/How-to-plot-3D-surface-graph-from-X-Y-Z-points/td-p/1193853/page/4
but I'm running into a bit of difficulty. I'm attempting to import 130 cell x 130 cell text file but the interpolated image isn't coming out as expected - I fear it may be something very simple that I'm just not grasping. I've given some of the text files that I'm attempting to demonstrate (one with 1 values surrounded by NaN, one with 1 values surrounded by 0s, and one with randomized values surrounded by 0s).
Thank you for your assistance in advance.
Solved! Go to Solution.
11-04-2022 09:13 AM
@Linty_C wrote:
Hi all,
I'm running into a bit of difficulty. I'm attempting to import 130 cell x 130 cell text file...
Show what you have tried and some one might be able to help.
11-04-2022 10:14 AM
I've tried as follows:
This is the output of the biharmonic spline using the Zeros & Random Values text file.
What I'm aiming for is a 3D model of this.
11-04-2022 10:49 AM
A snippet with glaring race conditions* and the absence of any data file make any help difficult. Then you show us a 2D picture explaining that you want a 3D model of "this". Way too ambiguous! I have no idea how that would look like!
Instead of a snippet, just zip your VI and your data file and attach it. Then explain exactly what you want to see!
* You are reading local variables (maxRx, etc.) way before their terminal receives any reasonable data. You need to eliminate all locals and only generate the ramps once the values are known, right? Dataflow! Execution order!
11-04-2022 11:57 AM
Besides the race condition, the next place to look would be the index arrays. Are you sure you are getting what you think you are?
I find that LV always gets it wrong and I must transpose the 2D array to get the data that I want.
11-04-2022 12:26 PM
@Frozen wrote:
Besides the race condition, ....
Yes, I only mentioned the tip of the iceberg. So many other things are wrong!
11-04-2022 01:59 PM
My apologies - I thought I had attached the text files and the VI in the first message. As far as the VI goes, I didn't write it. I'm simply trying to fashion it to my needs.
Thank you.
11-04-2022 02:36 PM
The data just seems to be a flat 2D array of z values, nothing more. I can't see where you want to get the x and y max values from.
11-04-2022 02:58 PM
I have the nagging feeling that this is all you need:
(If you can guarantee that there are no NaNs, you can even eliminate the loop stack)
11-04-2022 03:02 PM
Sorry, I get an error when tryin to save for previous (due to the 3D graph). Here's the code with the graph parts missing: Just reassemble.