怎么用matlab做y=x^5+x^4-7x^3+-0.75x^2+4x-8的图像,求高手帮忙,要详细点
x=0:7;y=(x-0.5)*(x+0.9)*(x-0.654)+(x-0.23)*(x-0.89)+(x-0.45)+7这一个应该怎么做?我这样写x=0:7;y=(x...
x=0:7;y=(x-0.5)*(x+0.9)*(x-0.654)+(x-0.23)*(x-0.89)+(x-0.45)+7 这一个应该怎么做? 我这样写 x=0:7;y=(x-0.5)*(x+0.9)*(x-0.654)+(x-0.23)*(x-0.89)+(x-0.45)+6;plot(x,y) 出现了??? Error using ==> mtimes nner matrix dimensions must agree.的问题 怎么解决
展开
1个回答
展开全部
clear all;
y=@(x)x.^5+x.^4-7*x.^3+-0.75*x.^2+4*x-8;
ezplot(y);grid on;
或者:
clear all;
x=-5:0.1:5;
y=x.^5+x.^4-7*x.^3+-0.75*x.^2+4*x-8;
plot(x,y);grid on;
-------------------
clear all;
x=0:0.1:7;
y=(x-0.5).*(x+0.9).*(x-0.654)+(x-0.23).*(x-0.89)+(x-0.45)+6;
plot(x,y);grid on;
y=@(x)x.^5+x.^4-7*x.^3+-0.75*x.^2+4*x-8;
ezplot(y);grid on;
或者:
clear all;
x=-5:0.1:5;
y=x.^5+x.^4-7*x.^3+-0.75*x.^2+4*x-8;
plot(x,y);grid on;
-------------------
clear all;
x=0:0.1:7;
y=(x-0.5).*(x+0.9).*(x-0.654)+(x-0.23).*(x-0.89)+(x-0.45)+6;
plot(x,y);grid on;
追问
x=0:7;y=(x-0.5)*(x+0.9)*(x-0.654)+(x-0.23)*(x-0.89)+(x-0.45)+7 这一个应该怎么做? 我这样写 x=0:7;y=(x-0.5)*(x+0.9)*(x-0.654)+(x-0.23)*(x-0.89)+(x-0.45)+6;plot(x,y) 出现了??? Error using ==> mtimes nner matrix dimensions must agree.的问题 怎么解决
追答
clear all;
x=0:0.1:7;
y=(x-0.5).*(x+0.9).*(x-0.654)+(x-0.23).*(x-0.89)+(x-0.45)+6;
plot(x,y);grid on;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询