06-30-2024 11:51 PM
Hi,
Thanks for your reply. I need to calculate individual columns' average, which means individual channels' average, and those to DDT and from DDT are used to save data in .csv format. But I want to see the average of individual columns in the display...
kind regards
Hasham
07-01-2024 01:11 AM - edited 07-01-2024 01:12 AM
Hi Hasham,
@Hasham622x wrote:
those to DDT and from DDT are used to save data in .csv format.
I told you more than once how to simplify your code, but you keep that Rube-Goldberg.
Again: you don't need all those ExpressVIs!
Suggestions:
07-02-2024 04:57 AM
Hi,
I tried to do without Express DDTs, and it was giving one large column, and I needed rows and columns. Due to that, I used two Express DDTs VI. Without that, it was giving the one long column. If you could guide me on how I could calculate averages of individual columns from an array of data?
Kind regards
Hasham
07-02-2024 07:06 AM
@Hasham622x wrote:
Hi,
I tried to do without Express DDTs, and it was giving one large column, and I needed rows and columns. Due to that, I used two Express DDTs VI. Without that, it was giving the one long column. If you could guide me on how I could calculate averages of individual columns from an array of data?
Don't transpose the input?
07-02-2024 07:29 AM
Hi,
Thanks for your reply. Yes, I tried that option, and in return, I was getting on one row. I am getting data from 4 channels (four columns) and 200 iterations (number of rows), so it should be an array of 4 x 200. So, after using express DDTs, I am getting the required form of data in a .csv file.
If you don't mind, could you please guide me on how I could calculate the average of each column (channel) and display it?
Once again thanks for your guidance.
Kind regards
Hasham
07-03-2024 12:44 AM
Hi,
I tried your suggestion, and it's working. If you don't, could you please tell me about the average of individual columns of array data in LabVIEW?
Kind regards
Hasham
07-03-2024 12:53 AM
Hi Hasham,
@Hasham622x wrote:
could you please tell me about the average of individual columns of array data in LabVIEW?
So you have a 2D array with several columns of data and you need the average of those columns?
Transpose the array, autoindex the rows in a FOR loop and use the mean function inside the loop…
07-03-2024 01:59 AM
Hi,
I tried to run by implementing the guidance you provided, but it is giving the current value of the channel within a conditional loop. Then I also put the mean function out of the while loop, and it gives wrong values like 2, 1, 3, 1, 1, 1.
I also attached both approach images with this message.
Kindly guide me.
Kind regards
Hasham
07-03-2024 02:37 AM - edited 07-03-2024 02:38 AM
Hi Hasham,
@Hasham622x wrote:
I tried to run by implementing the guidance you provided
Why do you need 3 ExpressVIs when I suggested to use a FOR loop and a (simple) Mean function???
What's wrong with my suggestion?
I repeat: "Transpose the array, autoindex the rows in a FOR loop and use the mean function inside the loop…"
07-03-2024 03:11 AM
Sorry and I didn't introduce DDT express when I connected it with subVI. Then it is attached by default, and thanks for sharing the image.
Kind regards
Hasham