我正在尝试在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;
答案 0 :(得分:2)
通过在*:
之前添加一个点来尝试元素乘法x = (Ac + m).*cos(2*pi*fc*t);