Chinmaye
Full Member level 3
Error "Subscript indices must either be real positive integers or logicals" in matlab
Hello all,
I am trying to run this simple program to calculate SNR. This is provided in the matlab documentation itself. But I get this error "Subscript indices must either be real positive integers or logicals."
Please help
Hello all,
I am trying to run this simple program to calculate SNR. This is provided in the matlab documentation itself. But I get this error "Subscript indices must either be real positive integers or logicals."
Code:
rng default
Tpulse = 20e-3;
Fs = 10e3;
t = -1:1/Fs:1;
x = rectpuls(t,Tpulse);
y = 0.00001*randn(size(x));
s = x + y;
pulseSNR = snr(x,s-x)
Please help