I can do this in MATLAB easily but I'm trying to do it Mathematica. I have a 27000 element (15 minutes*30 measurements per second) list of wind speed values. I want to find the max value in each 2700 element (90 second) range and output it to a vector. Here is the MATLAB code:

```
N = length(AlongWS);
SegTime = 90;
NSeg = (N/30)/90;
Max90 = zeros(NSeg,1);
Incr = N/NSeg;
for i = 1:NSeg
Max90(i,1) = max(AlongWS((i-1)*Incr+1:(i*Incr),1));
end
```

Here is what I've typed in Mathematica:

```
N = Length[AlongWS]
SegTime = 90
NSeg = (N/30)*60/SegTime
Max90 = {}
Incr = N/NSeg
For[
i = 1, i < NDiv + 1, i++,
maxWS[[i]] = Max[AlongWS[[(i - 1)*Incr + 1 ;; (i*Incr)]]]
]
```

Try this:

```
Max /@ Partition[AlongWS, 2700]
```

This partitions AlongWS into sub-lists of length 2700, and then maps `Max[]`

across the sub-lists, yielding a list of the maximum values of each 2700 element range.

Similar Questions

I know we can use find -exec ... to specify a command to run on each file, and output only those files for which the command succeeds, for example, find . -exec test -d {} \; -print will print out all

I am stuckwith a fairly simple problem: I need to construct a list with all permutations of values from two different lists in Mathematica. Let say, a={1,2} and b={4,5} I would need the result c={{1,4

The size and range of the integer value types in C++ are platform specific. Values found on most 32-bit systems can be found at Variables. Data Types. - C++ Documentation. How do you determine what th

Currently working on selenium webdrvier. I want to know how to select the week range values drop down at a time. Am having a drop down Period, Once i selected that week range from the period drop dow

I have, in Wolfram Mathematica 8.0, a nested list like: {{1,1,1},{0,0},{1,1,1,1,1},{0},{1,1},{0}} and would like to substitute the ones with the substring lengths as follows: {{3,3,3},{0,0},{5,5,5,

How can I convert .eps to .pdf inside Mathematica (perhaps using GhostScript?)?

I have a list and I want to apply a logical test to each element, and if any one of them does not satisfy this condition, then return false. I want to write this in Mathematica or find a built-in func

I have the specific result above in a select: 1 2 1 3 1 5 1 6 1 9 1 10 1 11 1 13 1 14 1 16 1 18 1 20 1 23 1 24 1 25 What I want to find is the longest increasing-by-one chain that occurs in the resul

I have the following example: Date1 <- seq(from = as.POSIXct(2010-05-01 02:00), to = as.POSIXct(2010-10-10 22:00), by = 3600) Dat <- data.frame(DateTime = Date1, t = rnorm(length(Date1))) I

I have a table called courses. The fields are: id, category, sortorder, fullname, etc..... What I am trying to do is given the category I want to find the maximum sortorder number in that category an

I'm using the Youtube API V3 but can't find documentation for how to filter by category: Here's my code: $results = $youtube->search->listSearch('id,snippet', array( 'q' => $_GET['q'], 'maxRe

I would like to write a Mathematica function that constructs a list of all Fibonacci numbers less than n. Moreover, I would like to do this as elegantly and functionally as possible(so without an expl

I am using Spring JDBCTemplate to perform a batchUpdate (insert) of a few thousand rows into an Oracle 10g database. To test my error handling, I made sure I get an exception about maximum length. I g

I am trying to find a profiling tool with which I can find out, how much time is spend on each line of code in a C/C++ program. I am working on Linux platforms (Ubuntu, Gentoo, SL) mainly with gcc. I

I am trying to find the n biggest values from a list, and then print out their position in the list. If I would only focus on the max. value, it would look like this: >>>>fr = [8,4,1,1,12

I want to find the location(s) of a specific item in a list of lists. It should return a list of tuples, where each tuple represents the indexes for a specific instance of the item. For example: list

Okay, I have exhausted my feeble knowledge of Excel VBA coding and have not been able to figure out this solution. I have a single column range of values as part of a table. The values in this column

I have a column with two value ranges, specifically 0-30000 and 60000+ from which I need to extract the smallest two values in the 60000 range. The only way I have found so far to to use AutoFilter to

How to find maximum observation length within a column so that i am able to apply formatted input while using input? data class; input name$; cards; Alfred Alice Barbara Carol Henry ; run;

I was looking for the maximum memory that Memcached can handle and how can I configure this property if there is such an option. So far, only thing I could find was the maximum size of the object that

I have a simple question: Below I'm filling an array with random values and finding the Max. I'd like to know the maximum size of the array that I can define (as the command line argument), without g

I need to find the maximum time value from the list: num[2] = 2012-12-16 16:56:31 I have tried with following: max =0 for num in list: if num[2] > max: max = num print max But it is showing error

I have a Mathematica 6 simulation that prints out rows of results now-and-then with a command similar to the following (with different numbers obviously): Print[GridBox[{{Cell[123456, Background->

In C#, how do I get a random number from a range of values - like 1..100, but that number should not be in some specific list of values, like 5, 7, 17, 23?

I have a List of Dictionaries that have keys of type string and values that are ints. Many of the dictionaries have the same keys in them but not all of them. So my question is: using LINQ how would I

I want to find an open local port in some range. How can I do that in the most efficient way, without connecting to the port.

For example in underscore/lowdash you can use _.max(list, [iterator], [context]) function to receive one maximum value. But I want to have it returned multiple maximum values if they are all equal. v

This may be a little difficult to explain, so I've written some code to demonstrate. It should just paste and run... but in a nutshell, if I set a split range (A1:A5,A7:A11 in the example) and refer

I get the list of all classes of my application. I want to find each Class from my list which inherits from MySpecificWrapperClass. int numClasses = objc_getClassList(NULL, 0); Class *classes = malloc

If I have an option, for example AxesStyle, how can I find possible values for it? I know that one of the possible values is Arrowheads, but can I find others? I was looking for lists or something lik

Using Python, what's the most efficient way to switch the positions of every other element in a list? For example, I'm trying to get a sequential list of the alphabet with each letter after A switched

I have data(points) that I have to import from another program to Mathematica, so I can plot it. I have control on how the points are going to be written to the file, so I can put them in any way I wa

I have two lists of numbers: parasite genome [1,1,1,0,1,0,1,0,1,1] host genome [1,1,0,0,1]) I am trying to find the chances of infection getting transferred from parasite to host. The transmission is

So I have a set of bounded diophantine equations that specify lines on the plane. I want to make mathematica plot the intersection of two of these equations so I can see what they look like. So far I

Here is my code.This is kinda noob question.how can I add action to a child in list view . This code contains an expandable list view whit 3 children and what I need is when I click on each child sepa

Ok so let's say we have a linked list of characters with a head pointer. How can I create a loop to enter a string of characters into the linked list? My problem is when I think of head and head->n

How much data can be added in java.util.List in Java at the maximum Is there any default size an array list?

I'm puzzled by Mathematica's responses to the following: ClearAll[n] #^2 & /@ Range[n] #^2 & /@ Range[n] // StandardForm It seems that even Mathematica (8.0) doesn't believe what it has just

Is there a maximum range of values passed in mt_rand() function? Is there a maximum 'top' number for it? Do said limitations depend on platform? Does mt_rand()'s speed depend on the range passed in?

I have a time-series like function which gives an output based on a list of real numbers(i.e. you can run the function on a list of 1,2,3,... real numbers). The issue I'm encountering is how to maximi

Let's say I have a data.frame that looks like this: ID B 1 1 1 2 1 1 1 3 2 2 2 2 2 2 2 2 3 2 3 10 3 2 Now I want to check the occurrences of B under each ID, such as that for no. 1, 1 happens twice,

How to find increasing subsequence of numbers with maximum sum. I find O(N^2) but I want to know O(N log N). Thanks!

I have a list of dictionaries. I am trying to implement a 'fuzzy' search of said dictionary values and have the full dictionary returned. Therefore, if I have a list of dicts as follows: [ {Name:Ar

I am attempting to ascertain the maximum sizes (in RAM) of a List and a Dictionary. I am also curious as to the maximum number of elements / entries each can hold, and their memory footprint per entry

I have many columns in oracle database and some new are added with values. I like to find out which columns have values other than 0 or null. So I am looking for column names for which some sort of us

I don't know why Wikipedia lists Mathematica as a programming language with printf. I just couldn't find the equivalent in Mathematica. My specific task is to process a list of data files with padded

I have a List<IAgStkObject>. Each IAgStkObject has a property called InstanceName. How can I search through my List to find if any of the contained IAgStkObject(s) have a particular InstanceName

I have got some values H, and I would like to find the maximum one using \+, how can i do it? maxValue(X) :- Get(Id, X), \+( Get(Id, Y), X < Y ). don't have a clue....please help, thanks!

I have 3 sets of data as shown in below: A=[3 1 4 2;7 9 8 3;7 5 3 6;4 1 9 3] B=[1 0 4 5;7 7 1 3;4 7 6 5;2 2 1 9] C=[9 1 3 7;9 6 5 5;1 4 3 2;0 3 2 1] I need to find out the maximum value when comparin

In Mathematica, calling Solve, returns a list of rules, e.g., In[1]:= g = Solve[(x - 1) (x - 2) == 0, x] Out[1]= {{x -> 1}, {x -> 2}} How can I extract the numerical values 1 or 2 from g? I tri