Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Can any one help me?

조회 수: 1 (최근 30일)
Kuheli Mondal
Kuheli Mondal 2016년 4월 4일
마감: MATLAB Answer Bot 2021년 8월 20일
how to solve this error?
??? Error: File: noise.m Line: 31 Column: 10
Unexpected MATLAB expression.
My mat lab code is
function x=signal(f,fs,N)
% sinusoid
f=30; %frequency,
N=20; %number of samples
fs=100; %sampling frequency
A=2; %amplitute
%Total sampling time = 1 second
n = 0:N-1; % numbering the samples
x = A*sin(2*pi*f*n/fs);
subplot(2,1,1);
plot(x)
title('Noise signal (x(n))')
axis([0,20,-2,2]);
ylabel('Amplitude');
xlabel('Discrete time n');
MFx = abs(fft(x));
frek=(0:N/2-1)*fs/N;
subplot(2,1,2)
plot(frek,MFx(1:N/2),'m')% plot the positive frequencies
title('FFT of Noise signal (x(n))');
axis([0 40 0 100]);
ylabel('Frequency');
xlabel('No. of Iteration');
k=10;
h=zeros(1,k);
h(3)=1;
h(4)=-2.7083;
h(5)=4.1861;
h(6)=-3.0451;
h(7)=0.73071;
d(n)=h(3)x(n-3)+h(4)x(n-4)+h(5)x(n-5)+h(6)x(n-6)+h(7)x(n-7);
ff_mix = abs(fft(d,1024));
subplot(2,2,1);
plot(d(n))
title('input: 1 primary signal (d(n))')
axis([0,20,-6,6]);
ylabel('Amplitude');
xlabel('Discrete time n');
subplot(2,2,2);
plot(ff_mix,'m');
title('FFT of primary signal (d(n))');
axis([0 1000 0 100]);
ylabel('Frequency');
xlabel('No. of Iteration');
Thank you very much

답변 (1개)

Walter Roberson
Walter Roberson 2016년 4월 4일
Your line
d(n)=h(3)x(n-3)+h(4)x(n-4)+h(5)x(n-5)+h(6)x(n-6)+h(7)x(n-7);
has nothing between the h(3) and the x that follows it. You have the same problem several times on that line.

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by