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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!