Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试绘制函数:f(x) = x * e^(x) * cos(x) 从 0 到 2*pi。我试过运行:
x = 0:pi/100:2*pi; y = x*exp(x)*cos(x)
但是,每次我尝试设置 y. Matlab 给我一个“使用 * 的错误”并说内部矩阵尺寸必须一致。对为什么会发生这种情况有任何见解吗?
你必须使用.*(元素乘法),而不是*(矩阵乘法)
.*
*