The objective of the following code is to generate a colored gaussian signal from a random gaussian noise;perform Fast Fourier Transform and also generate power signal. Questions:

1. I wanted to generate gaussian colored noise such that the power spectral densities is proprtional to 1/f^beta where beta=1,-1,2,0. Is the process correct?
2. The code generates error

??? Error using ==> rdivide
Matrix dimensions must agree.

Error in ==> expl at 9
x = x .\* 1./(f.^2);
Kindly help in solving this.Thank you