题目:
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.请问如何改正
解答:
用手工加点太麻烦了,还容易出错,最好用函数:clc;clearx=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
1.《matlab画图 matlab多项式画图》援引自互联网,旨在传递更多网络信息知识,仅代表作者本人观点,与本网站无关,侵删请联系页脚下方联系方式。
2.《matlab画图 matlab多项式画图》仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证。
3.文章转载时请保留本站内容来源地址,https://www.lu-xu.com/jiaoyu/550495.html