matlab如何产生基本信号以及进行信号的加减等运算

第一次用matlab,这个已知两连续时间信号试用MATLAB求
f(t)=f1(t)*f2(t),并绘出f(t)的时域波形图。

img

% 生成基本信号
t = linspace(0, 2*pi, 100);
f1 = sin(t);
f2 = sin(10*t);

% 进行信号加减运算
f3 = f1 + f2;
f4 = f1 - f2;

% 绘制时域波形图
subplot(2, 2, 1);
plot(t, f1);
title('f1(t)');
xlabel('t');
ylabel('f1');

subplot(2, 2, 2);
plot(t, f2);
title('f2(t)');
xlabel('t');
ylabel('f2');

subplot(2, 2, 3);
plot(t, f3);
title('f3(t)');
xlabel('t');
ylabel('f3');

subplot(2, 2, 4);
plot(t, f4);
title('f4(t)');
xlabel('t');
ylabel('f4');