MATLAB: Trouble Modulating .m File

MATLABmatlab function

So i created a sawtooth wave which i am trying to modulate using the DSB Technique. I am running into an error when trying to call the .m file. This first part is the signal I am generating. The second part is where i call the function. I'm stuck trying to modulate the signal. Any help would be greatly appreciated.
function y = HW3
% UNTITLED4 Summary of this function goes here
% Detailed % explanation goes here
n = 23; % Number of Harmonics
t = 0:.0002:n; % incremental value
y = sawtooth(t,.2); % Wave creation
plot(t,y);
ylabel ('Time');
xlabel ('Amplitude');
title('Sawtooth Wave');
end
function [ DSBModulation ] = DSB( DSBModulation )
% Program for DSB-AM
n = 23;
fc = 100;
t = 0:.0002:n;
sig = HW3;
c = cos((2*pi*fc*t));
u(t) = sig.*c;
plot(t,u(sig));
end

Best Answer

Change
u(t) = sig.*c;
plot(t,u(sig));
to
u = sig.*c;
plot(t, u);
Related Question