when i run the command, this message came to me (The expression to the left of the equals sign is not a valid target for an assignment)
조회 수: 3 (최근 30일)
이전 댓글 표시
%Define the time interval fs= 48000; Nsample=240000; t=0:1/fs:(Nsample-1)/fs;
%Define the function m(t) m =cos(2*pi*1000*t);
%Loop of n bits nbit=[1 2 3] for i_bit=1:length(nbit) L= 2^(nbit(i_bit)) Delta= 2/L Quantization= Delta*floor(m/Delta + 0.5) eq = m - Quantization end
x=nbit; if x=1; figure(1) subplot(311) plot(t,m,'b',t,Quantization,'r',t,eq,'g') title ('the time domain of signal') xlabel('Time') ylabel('Amplitude') xlim([0 0.01]) end
else if x=2; figure(1) subplot(312) plot(t,m,'b',t,Quantization,'r',t,eq,'g') title ('the time domain of signal') xlabel('Time') ylabel('Amplitude') xlim([0 0.01]) end else figure(1) subplot(313) plot(t,m,'b',t,Quantization,'r',t,eq,'g') title ('the time domain of signal') xlabel('Time') ylabel('Amplitude') xlim([0 0.01])
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Title에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!