用matlab得到有根区间向量

    技术2022-05-12  12

    function Xb=brackPlot(fun,xmin,xmax,nx)% BrackPlot find subintervals on x that contain sign changes of f(x)% Synopsis: Xb=brackPlot(fun,xmin,xmax,nx)%           Xb=brackPlot(fun,xmin,xmax)% Input:    fun=(string) name of mfile function that evaluates f(x)%           xmin,xmax=endpoints of interval to subdivide into brackets%           nx=(optional) number of samples along x axis used to test for%           brackets.The interval xmin<=x<=xmax is divided into nx-1%           subinterval. Default:nx=20%  Output:  Xb=two column matrix of bracket limits.%           Xb(k,1) is the left (lower x value) bracket and %           Xb(k,2) is the ringht bracket for the k^th potenntial root.%           If no bracket are found,Xb=[].if nargin < 4    nx=20;end

    % ----Plot f(x) on interval xmin <= x<= xmaxxp=linspace(xmin,xm


    最新回复(0)