怎样用MATLAB 画函数 y=-1/x+2*10^-10/x^9 的图形?已知x=(0.064,0.068,0.072,0.074,0.078,0.082,0.09,0.0961,0.1153,0.13,0.21,0.0.0.1)y=(7.2.-2.-5,-7.-8.75,-8.75,-7.-5,-2.-1.75,-1.375,-1.042)函数y=-a/x+b/

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 08:37:12
怎样用MATLAB画函数y=-1/x+2*10^-10/x^9的图形?已知x=(0.064,0.068,0.072,0.074,0.078,0.082,0.09,0.0961,0.1153,0.13,

怎样用MATLAB 画函数 y=-1/x+2*10^-10/x^9 的图形?已知x=(0.064,0.068,0.072,0.074,0.078,0.082,0.09,0.0961,0.1153,0.13,0.21,0.0.0.1)y=(7.2.-2.-5,-7.-8.75,-8.75,-7.-5,-2.-1.75,-1.375,-1.042)函数y=-a/x+b/
怎样用MATLAB 画函数 y=-1/x+2*10^-10/x^9 的图形?
已知x=(0.064,0.068,0.072,0.074,0.078,0.082,0.09,0.0961,0.1153,0.13,0.21,0.0.0.1)
y=(7.2.-2.-5,-7.-8.75,-8.75,-7.-5,-2.-1.75,-1.375,-1.042)
函数y=-a/x+b/x^9
请问如何用matlab拟合求出方程中的位置参数a、b。

怎样用MATLAB 画函数 y=-1/x+2*10^-10/x^9 的图形?已知x=(0.064,0.068,0.072,0.074,0.078,0.082,0.09,0.0961,0.1153,0.13,0.21,0.0.0.1)y=(7.2.-2.-5,-7.-8.75,-8.75,-7.-5,-2.-1.75,-1.375,-1.042)函数y=-a/x+b/
拟合参数,采用多元线性回归,程序如下:
clear;
clc;
x = [0.064 0.068 0.072 0.074 0.078 0.082 0.09 0.0961 0.1153 0.13 0.21 0.4 0.6 0.8 1];
y = [7.5 5 2.5 0 -2.5 -5 -7.5 -8.75 -8.75 -7.5 -5 -2.5 -1.75 -1.375 -1.042];
X1 = 1./x;
X2 = 1./(x.^9);
myX = [ones(1,length(y)); X1; X2]';
myY = y';
[B,BINT,R,RINT,STATS] = regress(myY,myX)
结果如下:
B =
-1.8715
-0.4460
0.0000
BINT =
-4.7448 1.0018
-0.8086 -0.0834
0.0000 0.0000
R =
-3.3298
2.0318
3.7514
2.5732
1.7737
0.1965
-1.5877
-2.7445
-3.1088
-2.2312
-1.0052
0.4865
0.8648
1.0540
1.2755
RINT =
-5.0347 -1.6250
-2.5935 6.6572
-0.6703 8.1731
-2.1996 7.3460
-3.1138 6.6611
-4.7980 5.1909
-6.4799 3.3046
-7.4448 1.9558
-7.8155 1.5979
-7.1867 2.7242
-6.0962 4.0858
-4.4445 5.4174
-3.9320 5.6616
-3.6615 5.7694
-3.3742 5.9251
STATS =
0.7936 23.0733 0.0001 5.7103
其中B即为参数.
所以方程为:
y=-1.8715/x-0.4460/x^9
绘制图像:
yy = B(1)./x+B(2)./x.^9;
plot(x,y,'ro',x,yy,'b')
图我就不贴了,自己运行就可以看到,但可以明确告诉你用你这组数据拟合成9阶效果肯定非常的差,因为:y=-a/x+b/x^9 中1/x^9将是当x偏离1时一个非常大的数,而当x接近1时确实个很小的数,差值非常的大.另外要拟合到9阶对数据量的需求也是非常大.你这15组根本达不到好的要求
有问题欢迎追问,觉得有用,

x = [1:0.1:10];
plot(x, y)

什么东西

怎样用matlab画函数y=2x/(1+x^2) 怎样用MATLAB画隐函数 x^4+y^2=1 的图像? 怎样用matlab画出函数17^2-16|x|y+17y^2=225的图像? 下列函数怎样用MATLAB编写M文件Z=-571.7-905.15x-23.21y 怎样用matlab拟合反比例函数像:y=a+b/x有自变量和对应值 怎样用matlab画出y=0.38*3.95*x/(1.85+0.845*x);的x,y的函数图,x的取值范围为0到1 怎样用Matlab画曲线例如画曲线:x^2+y^2+z^2=1x+y=1 怎样用MATLAB画类似X^3-X^2Y+XP^2+Y^3+1=0的曲线? 怎样用MATLAB实现 y=sinx/x 的曲线图? 有关matlab画直线x=[1:5];y=[2,4,5,7,9];怎样用matlab拟和成直线 怎样用matlab编写这个方程,z=(1+x)(1+y) 怎样用MATLAB画图 已知x y坐标 怎样用matlab画函数图怎样用matlab编程画这个函数图 Rt=R0*EXP[b(1/t-1/t0)]R0,b,t0为已知 一个数及函数怎样用矩阵表示比如说,1怎样用矩阵表示?y=x呢? 请问用matlab怎样求一个函数的最大值比如说y=x^3+x^2+1,怎样用matlab来算它的极值和最大值?怎样写程序? 怎样用MATLAB 画函数 y=-1/x+2*10^-10/x^9 的图形?已知x=(0.064,0.068,0.072,0.074,0.078,0.082,0.09,0.0961,0.1153,0.13,0.21,0.0.0.1)y=(7.2.-2.-5,-7.-8.75,-8.75,-7.-5,-2.-1.75,-1.375,-1.042)函数y=-a/x+b/ 请问知道y值和函数怎样用matlab求解x值,并且将该值画在图上>> k=-87.32/19516.67;>> x=[0:1:19516.67];>> y=k*x+87.32;>> plot(y);这个图像已经画出来了,现在我需要知道当Y=5时对应的x值,并画出y=5这条直线在原 求助matlab 中画函数 y=x+1/x x=0:0.2:10