Mathematica中文论坛-非官方

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 6708|回复: 0
打印 上一主题 下一主题

matlab 找曲线的拐点 儿子的papa

[复制链接]

532

主题

602

帖子

3031

积分

论坛元老

Rank: 8Rank: 8

积分
3031
跳转到指定楼层
楼主
发表于 2016-5-19 15:28:55 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
之前,在论坛里帮忙别人解决了一个问题。找一条曲线的拐点。
http://www.ilovematlab.cn/thread-319551-1-1.html

现在,自己也用到了。哈。记录下来。

  1. function [gu_D,gu_ind] = fun_find_guaidian(D,meps)

  2. n_D=length(D);

  3. delt1 = diff(D);
  4. delt2 = diff(delt1);

  5. judm1 = delt1(1:(n_D-2)).*delt1(2:n_D-1)>=0;
  6. judm2 = abs(delt2)>meps;

  7. gu_ind = find(judm1 & judm2) +1;
  8. gu_D = D(gu_ind);

  9. end
复制代码

  1. % D= [1 1.1 1.2 1.1 1.05 1.0 0.997 0.995 0.8 0.7 0.6 0.5 0.67 0.72];
  2. % meps=0.04;
  3. % [gu_D,gu_ind] = fun_find_guaidian(D,meps)
  4. %
  5. % hold on
  6. % plot(D,'.-')
  7. % plot(gu_ind,gu_D,'ro')
复制代码


fig_test_guaidian.jpg (43.58 KB, 下载次数: 822)

fig_test_guaidian.jpg
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|Mathematica中文论坛-非官方 ( 辽ICP备16001491号-1

GMT+8, 2024-4-28 12:44 , Processed in 0.113861 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表