不能在Matlab中绘图??使用== => mtimes'时发生错误(内部矩阵尺寸必须一致)。

时间:2021-03-04 16:13:12

when i type this equation in MatLab, I get the following error:

当我在MatLab中输入这个方程时,我得到如下错误:

x=linspace(0,8*pi,1000);
y=x*sin(x);

??? Error using ==> mtimes
Inner matrix dimensions must agree.

Thank you very much!

非常感谢!

1 个解决方案

#1


2  

Your question has nothing to do with plotting.

你的问题与阴谋毫无关系。

But you want element-wise multiplication. e.g., .* instead of *

但是你想要元素相乘。例如,*而不是*

x=linspace(0,8*pi,1000); y=x.*sin(x);

x = linspace(0 8 *π,1000);y = x。* sin(x);

http://stuff.mit.edu/afs/sipb/project/www/matlab/imatlab/node10.html

http://stuff.mit.edu/afs/sipb/project/www/matlab/imatlab/node10.html

#1


2  

Your question has nothing to do with plotting.

你的问题与阴谋毫无关系。

But you want element-wise multiplication. e.g., .* instead of *

但是你想要元素相乘。例如,*而不是*

x=linspace(0,8*pi,1000); y=x.*sin(x);

x = linspace(0 8 *π,1000);y = x。* sin(x);

http://stuff.mit.edu/afs/sipb/project/www/matlab/imatlab/node10.html

http://stuff.mit.edu/afs/sipb/project/www/matlab/imatlab/node10.html