>> x=0:0.01:4;
>> f(x)=x.^3-2*x.*sin(x);
Subscript indices must either be real positive integers or logicals.
这是为什么呢?要是x=0:0.01:4;f=x.^3-2*x.*sin(x);plot(x,f)这样直接输入就行
f(x)括号中x表示索引,而索引一定要是整数,所以,f(x)=x.^3-2*x.*sin(x);语句会弹出提示,而f=x.^3-2*x.*sin(x)语句不会弹出提示
本回答被提问者采纳