
From:  Windhorn, Allen E [ACIM/LS/MKT] 
Subject:  RE: how to get maximum last n element in array 
Date:  Fri, 6 Jul 2018 14:16:08 +0000 
> Original Message > From: Helpoctave [mailto:helpoctave > > i've matrix A > > i want to know the maximum value of last n element A = 1:22 Columns 1 through 17: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Columns 18 through 22: 18 19 20 21 22 >> n = 6 >> A(endn+1:end) # Last n elements ans = 17 18 19 20 21 22 >> max(A(endn+1:end)) # Max of last n elements ans = 22 Regards, Allen
[Prev in Thread]  Current Thread  [Next in Thread] 