Apologies if this is a relatively basic question - I'm still a bit new to programming, and particularly Matlab. Essentially I want to create 4940x1 column vector where each term is equal to the sum of a 4940x4940 square matrix's corresponding row. So far, easy enough. 

However, I would like each row to have a series of terms deleted from the sum, specifically the first 26 terms of the row for the first 26 rows, the 2nd 26 terms (i.e. terms 27-52) for the 2nd row, etc etc until you get to the 190th set of 26 terms (i.e. 4940,4915:4940) for the last 26 rows. I'm not sure if I'm explaining this well, so perhaps best illustrated with a magic 4 matrix :

A = 

```
    16     3     2    13;

     5    10    11     8;

     9     6     7    12;

     4    15    14     1

```

In addition to calculating the sum of each row, I would like to subtract 1,1:2 (i.e. 34-16-3) from row 1, 2,1:2 from row 2 (i.e. 34-5-10), 3,3:4 from row 3 (i.e. 34-7-12) and 4,3:4 from row 4 (34-14-1). 

Grateful for any help here!