±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 680  |  »Ø¸´: 2

wql212

½ð³æ (СÓÐÃûÆø)

[ÇóÖú] matlab Öк¯Êý rombint µÄÓ÷¨

ÈçÌ⣬º¯Êýrombint ÔõôÓúÍÒâÒåÊÇʲô£¿
ÁíÍ⣬һЩÁ¬ÐøµÄµÝÍÆ¼ÆËã³öÀ´µÄÊý¾Ý£¬ÈçºÎÕûºÏ³ÉÒ»¸öÁ¬ÐøµÄº¯Êý£¿
Çë¸ßÈËÖ¸µã!
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

libralibra

ÖÁ×ðľ³æ (ÖøÃûдÊÖ)

æôÆï½«¾ü

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï ¡ï ¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
csgt0: ½ð±Ò+1, лл 2013-01-11 15:11:43
wql212: ½ð±Ò+2 2013-01-11 17:13:49
Ó÷¨ºÍº¯ÊýÔ­ÐÍ
CODE:
function [res]=rombint(funfcn,a,b,decdigs,varargin);
%ROMBINT         Numerical evaluation of an integral using the Romberg method.
%
%   Q = rombint('F',A,B) approximates the integral of F(X) from A to B to
%   within a relative error of 1e-10 using Romberg's method of integration.
%   'F' is a string containing the name of the function.  The function
%   must return a vector of output values if a vector of input values is given.
%
%   Q = rombint('F',A,B,DECIMALDIGITS) integrates with accuracy 10^{-DECIMALDIGITS}.
%
%   Q = rombint('F',A,B,DECIMALDIGITS,P1,P2,...) allows coefficients P1, P2, ...
%   to be passed directly to the function F:   G = F(X,P1,P2,...).
%
%   Tested under MATLAB 5.2, works with all subsequent releases.
%   ---------------------------------------------------------
%   Author: Martin Kacenak,
%           Department of Applied Informatics and Process Control,
%           Faculty of BERG, Technical University of Kosice,
%           B.Nemcovej 3, 04200 Kosice, Slovak Republic
%   E-mail: ma.kac@post.cz
%   Date:   posted February 2001, updated June 2006.
%
if nargin<4, decdigs=10; end
if nargin<3
   warning ('Error in input format')
else
   rom=zeros(2,decdigs);
   romall=zeros(1,(2^(decdigs-1))+1);   
   romall=feval(funfcn,a:(b-a)/2^(decdigs-1):b,varargin{:});
   h=b-a;
   rom(1,1)=h*(romall(1)+romall(end))/2;
   for i=2:decdigs
      st=2^(decdigs-i+1);
      rom(2,1)=(rom(1,1)+h*sum(romall((st/2)+1:st:2^(decdigs-1))))/2;
      for k=1:i-1
         rom(2,k+1)=((4^k)*rom(2,k)-rom(1,k))/((4^k)-1);
      end
      rom(1,1:i)=rom(2,1:i);
      h=h/2;
   end
   res=rom(1,decdigs);
end

matlab/VB/python/c++/Javaд³ÌÐòÇë·¢QQÓʼþ:790404545@qq.com
2Â¥2013-01-10 16:56:25
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

wql212

½ð³æ (СÓÐÃûÆø)

ÒýÓûØÌû:
2Â¥: Originally posted by libralibra at 2013-01-10 09:56:25
Ó÷¨ºÍº¯ÊýÔ­ÐÍ
function =rombint(funfcn,a,b,decdigs,varargin);
%ROMBINT         Numerical evaluation of an integral using the Romberg method.
%
%   Q = rombint('F',A,B) approximates the integral of F(X ...

thank you ,but could you explain it to me?
3Â¥2013-01-10 17:08:30
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ wql212 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] Ò»Ö¾Ô¸ÄÏ¿ª´óѧ0710ÉúÎïѧ359Çóµ÷¼Á +3 ÍÃÍÃÍÃ111223314 2026-03-29 3/150 2026-03-29 23:14 by Evan_Liu
[¿¼ÑÐ] 375Çóµ÷¼Á +4 ÓêÏÄÕûÒ¹ 2026-03-29 4/200 2026-03-29 12:09 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] 332Çóµ÷¼Á +8 ½¶½¶123 2026-03-28 8/400 2026-03-29 10:46 by ÖÜè÷µ¤
[¿¼ÑÐ] ²ÄÁÏѧ˶333Çóµ÷¼Á +11 ±±µÀÏï 2026-03-24 11/550 2026-03-29 08:31 by fmesaito
[¿¼ÑÐ] 295²ÄÁϹ¤³Ìר˶Çóµ÷¼Á +7 1428151015 2026-03-27 7/350 2026-03-28 19:58 by S240
[¿¼ÑÐ] ʳƷ¹¤³Ìר˶һ־ԸÖк£Ñó309Çóµ÷¼Á +4 СÕÅzxyÕÅ 2026-03-26 8/400 2026-03-28 19:25 by lbsjt
[¿¼ÑÐ] 311£¨085601£©Çóµ÷¼Á +4 liziyeyeye 2026-03-28 4/200 2026-03-28 18:50 by 535743368
[²ÄÁϹ¤³Ì] Ò»Ö¾Ô¸C9²ÄÁÏÓ뻯¹¤×¨Òµ×Ü·Ö300Çóµ÷¼Á +8 Âü111 2026-03-24 9/450 2026-03-28 07:58 by YYYYX1234
[¿¼ÑÐ] ÕÅ·¼Ãú-Öйúũҵ´óѧ-»·¾³¹¤³Ìר˶-298 +4 ÊÖ»úÓû§ 2026-03-26 4/200 2026-03-28 07:17 by mmm just
[¿¼ÑÐ] 348Çóµ÷¼Á +4 СÀÁ³æ²»ÀÁÁË 2026-03-27 5/250 2026-03-27 12:47 by ¹û¹ûÂèßä
[¿¼ÑÐ] 298µ÷¼Á +3 jiyingjie123 2026-03-27 3/150 2026-03-27 11:57 by wxiongid
[¿¼ÑÐ] 292Çóµ÷¼Á +4 ÇóÇóÁËÊÕÏÂÎÒ°É£ 2026-03-26 4/200 2026-03-27 10:37 by zhshch
[¿¼ÑÐ] 276Çóµ÷¼Á¡£ÓаëÄêµç³ØºÍ°ëÄê¸ß·Ö×Óʵϰ¾­Àú +10 ²ÄÁÏѧ257Çóµ÷¼Á 2026-03-23 11/550 2026-03-27 10:13 by YCIT- LHL
[¿¼ÑÐ] 284Çóµ÷¼Á +11 junqihahaha 2026-03-26 12/600 2026-03-27 04:37 by wxiongid
[¿¼ÑÐ] 325Çóµ÷¼Á +5 Àî¼Îͼ¡¤S¡¤Â· 2026-03-23 5/250 2026-03-27 00:42 by wxiongid
[¿¼ÑÐ] 342Çóµ÷¼Á +3 ¼ÓÓÍaÀîzs 2026-03-26 3/150 2026-03-27 00:29 by wxiongid
[¿¼ÑÐ] 333Çóµ÷¼Á +6 wfh030413@ 2026-03-23 6/300 2026-03-26 22:45 by ѧԱ8dgXkO
[¿¼ÑÐ] 321Çóµ÷¼Á +6 wasdssaa 2026-03-26 6/300 2026-03-26 20:57 by sanrepian
[¿¼ÑÐ] 080500Çóµ÷¼Á +3 zzzzfan 2026-03-24 3/150 2026-03-24 16:38 by barlinike
[¿¼ÑÐ] ²ÄÁÏר˶331Çóµ÷¼Á +4 Ïʵ±Å£ 2026-03-24 4/200 2026-03-24 15:58 by JourneyLucky
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û