# Unable to understand SNR equation in Matlab

SNR_dB = 1:0.1:7
SNR = 10.^(SNR_dB/10)

• It is converting the SNR expressed in decibels to a linear (non-logarithmic) scale. Expressing the SNR in dB is convenient when plotting or in conversation, but most calculations need to be done in a linear scale. – MBaz Apr 18 '17 at 22:46

To express power $P$ in $\mathrm{dB}$ one performs this operation:
$$P_{\mathrm{dB}}=10\log_{10}(P)$$
$$\frac{P_{\mathrm{dB}}}{10}=\log_{10}(P) \implies 10^{\frac{P_{\mathrm{dB}}}{10}}=P$$
Note that the .^ means that the operation is being carried out element-wise.