Info

This question is closed. Reopen it to edit or answer.

urgent please help with this code . for modulation ask . vactorize

1 view (last 30 days)
Daniel Zeidan
Daniel Zeidan on 30 Apr 2016
Closed: Walter Roberson on 30 Apr 2016
keep getting an error
((Matrix dimensions must agree.
modulated = bw.*carrier
Error in Ask (line 19) modulated = bw.*carrier ;)) what should i do ? to make this code work ? i marked in bold the line that is causing the trouble . modulated = bw.*carrier
here is the code
if true
% code
end((clc;
clear all;
close all;
b = input ('Enter The Bit Stream\n'); % B is the binary Bit stream
fc = input ('carrier Frequency='); % F is the frequency carrier
n = length(b);
t = 0:.1:n;
x = 1:1:(n+1)*100;
for i = 1:n
for j = i:.1:i+1
bw(x(i*100:(i+1)*100)) = b(i);
end
end
bw = bw(100:end);
carrier = cos(2*pi*fc*t);
* * __modulated = bw.*carrier_*_* ;
subplot(3,1,1)
plot(t,bw)
grid on ;
ylable('amplitude')
xlabel('time')
title('message signal')
subplot(3,1,2)
plot(t, carrier)
grid on ;
ylabel( 'amplitude')
xlabel( 'time')
title ( 'carrier signal')
subplot(3,1,3)
plot(t,modulated)
grid on ;
ylabel( 'amplitude')
xlabel( 'time')
title ( 'modulated Signal')
))
close all;

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by