Info
この質問は閉じられています。 編集または回答するには再度開いてください。
I want to generate a sinusoidal signal with following lines of programme. It shows the error "Matrix dimensions must agree." Why is this error and what is the solution?
1 回表示 (過去 30 日間)
古いコメントを表示
N=512; %length of the signal n=0:N-1; phase=30; phase_in_rad=degtorad(phase); final_phase=phase_in_rad*(1:9);
x=sin(2*pi*(25/N)*n+(final_phase))+sin(2*pi*(60/N)*n+(final_phase))+cos(2*pi*(110/N)*n-(final_phase));
figure; subplot(2,1,1); plot(x,'g') grid on; xlabel('Samples'); ylabel('Amplitude of the signal'); title('Main Signal');
xf=fft(x);
xfmag=10*log10(abs(xf));
subplot(2,1,2); plot(abs(xf),'r') grid on; xlabel('Samples'); ylabel('Amplitude'); title('Absolute value of FFT of x');
0 件のコメント
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!