matlab2019a线性分析在哪

matlab2019a线性分析在哪,第1张

matlab+2019a中的linear+analysis在设置的最后一行里面的。,Control System Toolbox™ software lets you analyze the dynamics of linear systems. You can visualize system behavior in time domain and frequency domain. You can extract system characteristics such as rise time, overshoot, and settling time. You can also analyze system stability. Use these tools to analyze the behavior of plant models or validate the performance of a tuned control system.

线性拟合如下:

------------------------------------------------------------------

x=[0 20 40 60 100 130 160 190]

y=[18 17.586 17.136 16.704 15.84 15.129 14.544 13.896]

a=polyfit(x,y,1)

xi=0:0.001:200

yi=polyval(a,xi)

plot(x,y,'go','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',6)

xlabel('深度/m','fontsize',16)

ylabel('温度/℃','fontsize',16)

axis([0 200 12 20])

hold on

plot(xi,yi,'linewidth',2,'markersize',16)

legend('原始数据点','拟合曲线')

sprintf('直线方程:Y=%0.5gxX+%0.5g',a(1),a(2))

-----------------------------------------------------------------

指数拟合如下:

-----------------------------------------------------------------

先定义函数:

function Y=nhfun(b,x)

Y=b(1)*exp(b(2)*x)+b(3)

在运行程序:

x=[0 20 40 60 100 130 160 190]

y=[18 17.586 17.136 16.704 15.84 15.129 14.544 13.896]

x0=[0,1,0]  %设置初始值

b=lsqcurvefit(@nhfun,x0,x,y)

Xi=0:0.001:200

Yi=b(1)*exp(b(3)*Xi)+b(2)

plot(x,y,'cp','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',6)

hold on

plot(Xi,Yi,'linewidth',2,'markersize',16)

legend('原始数据点','拟合曲线')

sprintf('曲线方程:Y=%0.5g+e^(%0.5gxX)+(%0.5g)',b(1),b(2),b(3))

--------------------------------------------------------------

!!!曲线方程程序运行时会报错,是因为你的X数据中有一个为0,这个不影响结果的

图每次只能发一张,所以我发到你邮箱哈


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/11334250.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存