clear all;clc;f=60;Fs=57600;T=1/Fs;N=960;t=0:0.000017:0.02;m=0;%x=sin(2*pi*f*t);
y=sqrt(2)*15.66*cos(2*pi*f.*t);for n=1:960; x(n)= y(n) real(n)=cos(2*pi*(1/960)*(n-1)); imag(n)=sin(2*pi*(1/960)*(n-1)); m=m+1endfor n=1:960; F(n)=y(n)*(real(n)+imag(n))endplot(t,F(n))
MATLAB: I am writing a code for DFT and getting this error. ‘subscript indices must either be real positive integers or logicals’. My code is as under. Can somebody help me with it? I have used both logical and round commands but still getting the same err
error
Best Answer