我想知道是否有可能将一个函数与squarePulse相乘。
我试图编写这段代码,但这是错误的:
Tc = 0.01;
t = [0:Tc:3];
y = t.^2 * rectangularPulse(1,2,t);
你能告诉我是否有解决方案(我想使用rectanglePulse,而不是其他功能)?
错误如下:
Error using *
Inner matrix dimensions must agree.
Error in aaa (line 12)
y = t.^2 * rectangularPulse(1,2,t);
谢谢您的时间。
答案 0 :(得分:3)
乘法应该是逐元素乘法:
y = t.^2 .* rectangularPulse(1,2,t);