zoukankan      html  css  js  c++  java
  • matlab中fminbnd函数求最小或者组大值

    clc;
    clear all;
    close all;
    
    fx = @(x) -(0.4./sqrt(1 + x.^2) - sqrt(1+x.^2) .* (1- 0.4./(1 + x.^2))+x);
    [x0, f] =fminbnd(fx,0,2);  % f利用负号求最小值
    x = 0 :0.1: 2;
    y = feval(fx,x);
    %% ========maxvalue====
    figure
    plot(x,-y,'b-','linewidth',2)
    hold on
    plot(x0,-f,'o','markersize',8,'linewidth',2,'markerFacecolor','g')
    xlabel('x')
    ylabel('y')
    text(x0, -f-0.02, 'maxvalue')
    %% ==============minvalue=======
    %% ========maxvalue====
    figure(2)
    plot(x,y,'b-','linewidth',2)
    hold on
    plot(x0,f,'o','markersize',8,'linewidth',2,'markerFacecolor','g')
    xlabel('x')
    ylabel('y')
    text(x0, f+0.02, 'minvalue')
    

      

  • 相关阅读:
    JMeter和JMeterPlugin 下载安装
    Beanshell语法
    逻辑控制器
    常用配置元件
    jmeter结构体系
    正则表达式提取器
    ab 测试工具
    spring cloud_docker
    jmeter+maven
    TFS
  • 原文地址:https://www.cnblogs.com/Kermit-Li/p/6025401.html
Copyright © 2011-2022 走看看