From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-13-2024 10:35 AM - edited 06-13-2024 10:36 AM
I have a 6D array with 1 row having the following format:
Flow Rate | Flow Rate TimeStamp | Mean Arterial Pressure | Mean Arterial Pressure Timestamp | Beats Per Minute | Beats Per Minute Time Stamp
What I need to do is find the Flow Rates / MAP's / BPM's that are closest to each other in meausurement (timestamp) time and recreate the same array but sorted that way.
How could I go about this in LabVIEW?
06-13-2024 10:41 AM - edited 06-13-2024 10:44 AM
Hi Alain,
@alainschaerer wrote:
I have a 6D array with 1 row
Please explain the term "row" with respect to your 6-dimensional array!
@alainschaerer wrote:
Flow Rate | Flow Rate TimeStamp | Mean Arterial Pressure | Mean Arterial Pressure Timestamp | Beats Per Minute | Beats Per Minute Time Stamp
What I need to do is find the Flow Rates / MAP's / BPM's that are closest to each other in meausurement (timestamp) time and recreate the same array but sorted that way.
Hopefully you have a 2D array with 6 columns!
06-13-2024 11:00 AM
Yes, my row has 6 columns.
"You want to compare a timestamp with your column of timestamps to find the closest index? What about subtracting the timestamp from the 1d array of timestamps and finding the value closest to zero ( which is the same as the minimum of that absolute values of the differences)!?"
Im not sure what you mean by that. Could you elaborate?
Would I convert the array into 3 1d arrays of timestamps and then find whichever are closest to each other by subtracting all of them with eachother: abs(timestamp1 - timestamp2 - timestamp3) and then optimize for the ones that are closest to 0?
If yes, how would I do that in labview and how would I then rearrange the original array?
06-13-2024 11:20 AM
Hi Alain,
@alainschaerer wrote:
Yes, my row has 6 columns.
So you have "just" a 2D array of values - in contrast to your first message where you claimed a 6D array?
@alainschaerer wrote:
"You want to compare a timestamp with your column of timestamps to find the closest index? What about subtracting the timestamp from the 1d array of timestamps and finding the value closest to zero ( which is the same as the minimum of that absolute values of the differences)!?"
Im not sure what you mean by that. Could you elaborate?
Now you have found the index closest to your "timestamp of interest". (Simple math!)
@alainschaerer wrote:
Would I convert the array into 3 1d arrays of timestamps and then find whichever are closest to each other by subtracting all of them with eachother: abs(timestamp1 - timestamp2 - timestamp3) and then optimize for the ones that are closest to 0?
Please provide an example VI with an example array of values.
Please provide a "timestamp of interest" also - and provide an expected result for all your required results!
(When providing your VI take care of downconverting for older LV versions in case you use a recent LabVIEW version. I prefer LV2019…)