e[q_,nb_,n_,k_]:=Cos[3^(n-k)*nb*q];

Clear[T,CC,DD,M1,res]

e[1,1]

N[e[1,1]]

h[q_,nb_,n_,k_]:=Cos[3^(n-k)*nb*q];

f[q_,nb_,n_,k_]:=-Sin[3^(n-k)*nb*q];

g[q_,nb_,n_,k_]:=Sin[3^(n-k)*nb*q];

T[q_,nb_,n_,k_]:={{e[q,nb,n,k],f[q,nb,n,k]},{g[q,nb,n,k],h[q,nb,n,k]}};

T[1,1]

CC[na_,nb_]:={{1,0},{0,na/nb}};

DD[na_,nb_]:={{1,0},{0,nb/na}};

M1[q_,na_,nb_,k_]:=T[q,nb,0,k].CC[na,nb].T[q,nb,0,k].DD[na,nb]T[q,nb,0,k];

M1

M1[q,na,nb]

CC[1,1]

g[1,1]

T[1,1]

Clear[M1,e,f,g,h,T]

T[q,nb].CC[na,nb]

CC[na,nb]

T[q,nb]

{{1,2},{3,4}}.{{k,l},{m,n}}

Clear[M1]

res[q_,na_,nb_]:=RecurrenceTable[{a[n+1]-e[q,nb]*a[n]^2-f[q,nb]*a[n]*c[n]-g[q,nb]*b[n]*a[n]-h[q,nb]*b[n]*c[n]==0,b[n+1]-e[q,nb]*a[n]*b[n]-f[q,nb]*a[n]*d[n]-g[q,nb]*b[n]^2-h[q,nb]*b[n]*d[n]==0,c[n+1]-e[q,nb]*a[n]*c[n]-f[q,nb]*c[n]*c[n]-g[q,nb]*d[n]*a[n]-h[q,nb]*c[n]*d[n]==0,d[n+1]-e[q,nb]*b[n]*c[n]-f[q,nb]*b[n]*c[n]-g[q,nb]*d[n]*b[n]-h[q,nb]*d[n]*d[n]==0, a[1]==M1[q,2,1][[1,1]],b[1]==M1[q,2,1][[1,2]],c[1]==M1[q,2,1][[2,1]],d[1]==M1[q,2,1][[2,2]]},{a[n],b[n],c[n],d[n]},{n,1,10}];

res[q,na,nb]

res2[q_]:=RecurrenceTable[{a[n+1]-e[q,1]*a[n]^2-f[q,1]*a[n]*c[n]-g[q,1]*b[n]*a[n]-h[q,1]*b[n]*c[n]==0,b[n+1]-e[q,1]*a[n]*b[n]-f[q,1]*a[n]*d[n]-g[q,1]*b[n]^2-h[q,1]*b[n]*d[n]==0,c[n+1]-e[q,1]*a[n]*c[n]-f[q,1]*c[n]*c[n]-g[q,1]*d[n]*a[n]-h[q,1]*c[n]*d[n]==0,d[n+1]-e[q,1]*b[n]*c[n]-f[q,1]*b[n]*c[n]-g[q,1]*d[n]*b[n]-h[q,1]*d[n]*d[n]==0, a[1]==M1[q,2,1][[1,1]],b[1]==M1[q,2,1][[1,2]],c[1]==M1[q,2,1][[2,1]],d[1]==M1[q,2,1][[2,2]]},{a[n],b[n],c[n],d[n]},{n,1,5}];

res2[[10]]

res2[1][[10]]

res2[q][[10]]

Clear[e,f,g,h,res2,DD,CC,T,M1]
lis:={};

For[q=1.q<11,q++, AppendTo[lis, {res2[q/10][[10]]}]]

lis

res2[1][[10]]

res2[q]