matlab 去找出斜率变化率最大的点。

14 views (last 30 days)
qepjwfvt
qepjwfvt on 25 May 2023
Answered: qunufker on 25 May 2023
各位matlab 前辈,matlab 拟合两组数据点 ,一组x ,一组y ,我想利用matlab 去找出斜率变化率最大的点,应该怎么去编程,不需要拟合方程,只需要作出曲线图像和找出点就好,谢谢各位前辈

Accepted Answer

qunufker
qunufker on 25 May 2023
编个例子你自己看一下
x = [1,2,3,4,5,6,7];
y = [2,3,3,5,7,21,43];
假设你已经有了
x,y的数据
那么
for i=1:length(x)-1
z(i) = (y(i+1)-y(i))/(x(i+1)-x(i));
end
c = abs(z(2:end))-abs(z(1:end-1));
[a,b] = max(c)
a是斜率变化最大值,b是对应的点
a是绝对值最大的斜率,b对应第几个节点斜率最大

More Answers (0)

Categories

Find more on MATLAB 快速入门 in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!