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개)

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by