使用 * 时出错 内部矩阵尺寸必须一致

Error using * Inner matrix dimensions must agree

我正在尝试在 matlab 中计算一些函数,但出现此错误:

Error using  * 
Inner matrix dimensions must agree.

Error in set1 (line 11)
x = (Ac + m)*cos(2*pi*fc*t);

但我没有在我的代码中使用任何类型的矩阵。问题是什么?

这是我的代码:

fs = 10000;
Ts = 1/fs;
t = (0:Ts:10);
m = cos(2*pi*t);
plot(t,m);
figure;

Ac = 2;
fc = 500;
x = (Ac + m)*cos(2*pi*fc*t);
plot(t,x);
figure;

通过在 *:

前加一个点来尝试按元素乘法
x = (Ac + m).*cos(2*pi*fc*t);