matlab多项式画图已知多项式为y=1.4017*10^(1/24)*x^10-8.0132*10^(1/21)*x^9+1.96*10^(1/17)*x^8-2.6776*10^(1/14)*x^7+2.2366*10^(1/11)*x^6-1.1746*10^(1/8)*x^5+3.8326*10^(1/6)*x^4-0.0007347*x^3+0.072265*x^2-2.5331*x+25.817,x的取值范围是0
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 18:29:50
matlab多项式画图已知多项式为y=1.4017*10^(1/24)*x^10-8.0132*10^(1/21)*x^9+1.96*10^(1/17)*x^8-2.6776*10^(1/14)*x^7+2.2366*10^(1/11)*x^6-1.1746*10^(1/8)*x^5+3.8326*10^(1/6)*x^4-0.0007347*x^3+0.072265*x^2-2.5331*x+25.817,x的取值范围是0
matlab多项式画图
已知多项式为y=1.4017*10^(1/24)*x^10-8.0132*10^(1/21)*x^9+1.96*10^(1/17)*x^8-2.6776*10^(1/14)*x^7+2.2366*10^(1/11)*x^6-1.1746*10^(1/8)*x^5+3.8326*10^(1/6)*x^4-0.0007347*x^3+0.072265*x^2-2.5331*x+25.817,x的取值范围是0到1080.
编码:
x=1:5:1080;
y=1.4017*10^(1/24)*x^10-8.0132*10^(1/21)*x^9+1.96*10^(1/17)*x^8-2.6776*10^(1/14)*x^7+2.2366*10^(1/11)*x^6-1.1746*10^(1/8)*x^5+3.8326*10^(1/6)*x^4-0.0007347*x^3+0.072265*x^2-2.5331*x+25.817;
plot(x,y);
错误是:
y=1.4017*10^(1/24)*x^10-8.0132*10^(1/21)*x^9+1.96*10^(1/17)*x^8-2.6776*10^(1/14)*x^7+2.2366*10^(1/11)*x^6-1.1746*10^(1/8)*x^5+3.8326*10^(1/6)*x^4-0.0007347*x^3+0.072265*x^2-2.5331*x+25.817;
|
Error:Missing variable or function.
请问如何改正
matlab多项式画图已知多项式为y=1.4017*10^(1/24)*x^10-8.0132*10^(1/21)*x^9+1.96*10^(1/17)*x^8-2.6776*10^(1/14)*x^7+2.2366*10^(1/11)*x^6-1.1746*10^(1/8)*x^5+3.8326*10^(1/6)*x^4-0.0007347*x^3+0.072265*x^2-2.5331*x+25.817,x的取值范围是0
用手工加点太麻烦了,还容易出错,最好用函数:
clc;clear
x=1:5:1080;
y='1.4017*10^(1/24)*x^10-8.0132*10^(1/21)*x^9+1.96*10^(1/17)*x^8-2.6776*10^(1/14)*x^7+2.2366*10^(1/11)*x^6-1.1746*10^(1/8)*x^5+3.8326*10^(1/6)*x^4-0.0007347*x^3+0.072265*x^2-2.5331*x+25.817';
y=vectorize(y)
y=eval(y);
plot(x,y);
结果:
y =
1.4017.*10.^(1./24).*x.^10-8.0132.*10.^(1./21).*x.^9+1.96.*10.^(1./17).*x.^8-2.6776.*10.^(1./14).*x.^7+2.2366.*10.^(1./11).*x.^6-1.1746.*10.^(1./8).*x.^5+3.8326.*10.^(1./6).*x.^4-0.0007347.*x.^3+0.072265.*x.^2-2.5331.*x+25.817