Question: Write a function called winmax that receives a vector of real numbers as the first input argument, and a scalar representing the window size as
Write a function called winmax that receives a vector of real numbers as the first input argument, and a scalar representing the window size as the second input argument. The function should find and return the maximum window sum for the specified window size and vector.
Here are several examples of what calling winmax might look like:
>> winmax([1 8 -3 2 7 4 -5], 1)
ans =
8
>> winmax([1 8 -3 2 7 4 -5], 2)
ans =
11
>> winmax([1 8 -3 2 7 4 -5], 3)
ans =
13
>> winmax([1 8 -3 2 7 4 -5], 4)
ans =
14
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
