问题描述:
MATLAB中plot函数用法
MATLAB中输入
>> x=1:0.1:3
f=sin(x)*(1+x)*log(1+x);
plot(x,f)
运行出错?Error using ==> mtimes
Inner matrix dimensions must agree.
如果改成
>> x=1:0.1:3
f=sin(x).*(1+x).*log(1+x);
plot(x,f)
运行正确,可以绘出图形来.想知道sin(x)、(1+x)后面为什么必须加一个“.”才能运行?这个“.”代表什么,具体怎么用,什么地方加,什么地方不加?我是初学者.
MATLAB中输入
>> x=1:0.1:3
f=sin(x)*(1+x)*log(1+x);
plot(x,f)
运行出错?Error using ==> mtimes
Inner matrix dimensions must agree.
如果改成
>> x=1:0.1:3
f=sin(x).*(1+x).*log(1+x);
plot(x,f)
运行正确,可以绘出图形来.想知道sin(x)、(1+x)后面为什么必须加一个“.”才能运行?这个“.”代表什么,具体怎么用,什么地方加,什么地方不加?我是初学者.
问题解答:
我来补答展开全文阅读