Let's define a few new variables. But first, here are the definitions of the three original variables from your code:
t = xlsread('trandom','E2:E59');
y = xlsread(rtemp.xlsx','H2:H59');
Rather than calling sin and cos repeatedly on individual elements of the vector t, I'll call them once on the whole vector. I can then use those vectors to define the terms that are the product of the sines and cosines, taking advantage of array (element-wise) multiplication.
st = sin(t);
ct = cos(t);
sst = st.*st;
sct = st.*ct;
cct = ct.*ct;
cst = ct.*st;
Now, looking at the pattern for A, it looks like we have:
A = [ N, sum(st), sum(ct); ...
sum(st), sum(sst), sum(sct); ...
sum(ct), sum(sct), sum(cct)];
I'm assuming the variable t is a vector. If it's not, you can either make it a vector before defining the variables st and ct or you can (if you're using a sufficiently new release) specify that you want to sum over 'all' the dimensions of the variable.
A = magic(3)
s1 = sum(A)
sA = sum(A, 'all')
You can do something similar definining variables for the combinations of y and functions of t, and use those to define b.