I forgot that the Z matrix has not one, but two variables, y1 and w, for n=3 (for example).
Where, y(1,n)=sym(['y',num2str(n)]);
And Z =
[1,1,0,0]
[0,0,-1,-1]
[exp((30650000^(1/2)*((w^4)^(1/2) + w^2)^(1/2)*308151*i)/766250000)*exp((308151*(30650000*(w^4)^(1/2) - 30650000*w^2)^(1/2))/766250000), exp(-(30650000^(1/2)*((w^4)^(1/2) + w^2)^(1/2)*308151*i)/766250000)*exp(-(308151*(30650000*(w^4)^(1/2) - 30650000*w^2)^(1/2))/766250000), y1*exp((30650000^(1/2)*((w^4)^(1/2) + w^2)^(1/2)*308151*i)/766250000)*exp((308151*30650000^(1/2)*((w^4)^(1/2) - w^2)^(1/2))/766250000), y1*exp(-(30650000^(1/2)*((w^4)^(1/2) + w^2)^(1/2)*308151*i)/766250000)*exp(-(308151*30650000^(1/2)*((w^4)^(1/2) - w^2)^(1/2))/766250000)]
[y1*exp((30650000^(1/2)*((w^4)^(1/2) + w^2)^(1/2)*308151*i)/766250000)*exp((308151*30650000^(1/2)*((w^4)^(1/2) - w^2)^(1/2))/766250000), y1*exp(-(30650000^(1/2)*((w^4)^(1/2) + w^2)^(1/2)*308151*i)/766250000)*exp(-(308151*30650000^(1/2)*((w^4)^(1/2) - w^2)^(1/2))/766250000), -exp((30650000^(1/2)*((w^4)^(1/2) + w^2)^(1/2)*308151*i)/766250000)*exp((308151*30650000^(1/2)*((w^4)^(1/2) - w^2)^(1/2))/766250000), -exp(-(30650000^(1/2)*((w^4)^(1/2) + w^2)^(1/2)*308151*i)/766250000)*exp(-(308151*30650000^(1/2)*((w^4)^(1/2) - w^2)^(1/2))/766250000)]
Sorry for my mistake.