07-23-2020 02:04 PM
Hello.
I have a two-dimensional array (XY) and from that I have created a graph of Y as a function of X.
I want to get multiple Y values (for different X values) and use them within the software.
Anyone know how to help me?
If there is an explanatory video it would be great.
I'm been sitting on this for a long time ...
07-23-2020 02:12 PM - edited 07-23-2020 02:15 PM
Please attach a simple VI showing your data structures.
Your description is very ambiguous because you use the term X and Y in seemingly unrelated contexts: Is the 2D array just two rows (or columns), one for X and one for Y or is the data 3D where the two array indices are X and Y and the element value is Z? Where are the multiple Y values for each X located? are all X values unique? Are they ordered (e.g. non-descending)? Do you want interpolation if the desired X does not exist?
07-23-2020 02:42 PM
First of all thank you.
I have attached a vi file that will explain my intention.
I want to know what the value of array Y2 is as a function of array X1, but array X1 is different from array X2 (they have the same initial value and finite value, but their construct values are different).
07-23-2020 03:19 PM
OK, your VI does not have a single 2D array anywhere. You can just interpolate. Try this:
(Note that you don't need any express VIs to do an XY graph!)
07-23-2020 03:38 PM
it worked!!!
Wow, thank you so much.
07-23-2020 04:36 PM
The proper protocol is to mark the message that actually gave you the answer as the solution, (or you can mark more than one message if several helped), not your "Thank You" message.
1. It allows someone looking at this thread in the future to know precisely which message was the solution.
2. It gives credit to the person who supplied you the solution.
07-23-2020 04:52 PM
@segkash wrote:Wow, thank you so much.
Of course it works! Now make sure you understand exactly what the code does and how "interpolate 1D array" functions when given a array of xy points as done here. This is a very useful function!