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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%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 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Title dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!