boliva Posted July 13, 2022 Share Posted July 13, 2022 How can I combine multiple channels to be the max at each time point? For instance, let's say I have three channels as per below. Temp1[0,3] = {5, 12, 43, 2} Temp2[0,3] = {7, 9, 6, 8} Temp3[0,3] = {8, 7, 7, 8} I want to know the max value at each time point...so I want the below resulting array... maxTemp = {8, 12, 43, 8} Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted July 13, 2022 Share Posted July 13, 2022 You'd have to combine that into a single array, then do maxcols() on it: private arr = temp1[0,3] arr[][1] = temp2[0,3] arr[][2] = temp3[0,3] private maxTemp = maxcols(arr) So, the max() function takes the maximum across the first (rows) dimension and is always the one with time associated. It is the most common form since most arrays are only 1 dimensional. MaxCols() takes the maximum across the second (column) dimension. We build up arr as an array with 4 rows and 3 columns, one column for each channel. By doing maxCols() we are saying we want the maximum for each row (in time), across all columns. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.