08-22-2011 01:35 PM
I have derived an X-plot (frequencies) for each point off my spectrum analyzer, and am reading the Y-trace (amplitude) ... both are an array of data. I'm trying to get them to cooperate into a XY Plot. When I try to bundle them then connect it to the XY Plot, it tells me that I'm trying to connect 2 arrays where its expecting 1-D array of 2 elements.
How can I take my 2 arrays and transform them into 1-D array of 2 elements?
08-22-2011 01:45 PM
An XY Graph takes a cluster of two arrays. So what you described should work. Did you use a Build Array primitive rather than Bundle. Please post a simple example of what you have tried (using array constants or controls for the data, not your spectrum analyzer).
Lynn
08-22-2011 01:54 PM - edited 08-22-2011 01:55 PM
You have saveral choices to create valid data for an xy graph:
I would go with the last option 🙂
(To create multiple plots on an xy graph built a cluster array of complex arrays)
08-22-2011 01:58 PM
Seems to me the simplest option here is to use Index & Bundle Cluster Array. Feed in your X and Y arrays and the output will be an array of clusters of 2 elements.
08-22-2011 02:28 PM
Just so happened, I have a for loop in which I am using to derive all the X points. So if I take the output of the frequency calculation, and bundle it with the Y-trace inside the for loop, then the result should be an indexed 1-D array of 2 elements? The lines connect now with no complaints. Still isn't drawing anything on the X-Y Plot. But I think a definite step in the right direction - thanks.
08-22-2011 02:45 PM
can you post your code and the output that you expect.
08-22-2011 02:49 PM
The problem I'm having right now is due to instrument drivers - or rather, my not selecting the right one to give me the number of points along the entire span of Y trace apparently. So I'm waiting assistance from the vendors on this. If I am still having problems after I get that straightened out, I will post an example of code to help give you an idea of what I'm attempting.