24小时热门版块排行榜    

查看: 665  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 294求调剂材料与化工专硕 +14 陌の森林 2026-03-18 14/700 2026-03-19 22:38 by 学员8dgXkO
[考研] 0703化学调剂 +4 18889395102 2026-03-18 4/200 2026-03-19 16:13 by 30660438
[考研] 一志愿北京化工大学0703化学318分,有科研经历,求调剂 +3 一瓶苯甲酸 2026-03-14 3/150 2026-03-19 15:17 by 尽舜尧1
[考研] 本人考085602 化学工程 专硕 +17 不知道叫什么! 2026-03-15 19/950 2026-03-19 15:06 by 尽舜尧1
[考研] 材料与化工求调剂 +7 为学666 2026-03-16 7/350 2026-03-19 14:48 by 尽舜尧1
[考研] 求调剂,一志愿:南京航空航天大学大学 ,080500材料科学与工程学硕,总分289分 +3 @taotao 2026-03-19 3/150 2026-03-19 14:07 by peike
[考研] 328求调剂,英语六级551,有科研经历 +4 生物工程调剂 2026-03-16 12/600 2026-03-19 11:10 by 生物工程调剂
[考研] 354求调剂 +4 Tyoumou 2026-03-18 7/350 2026-03-18 21:45 by Tyoumou
[考研] 一志愿武理材料305分求调剂 +5 想上岸的鲤鱼 2026-03-18 6/300 2026-03-18 17:53 by 无际的草原
[考研] 302求调剂 +10 呼呼呼。。。。 2026-03-17 10/500 2026-03-18 12:45 by Linda Hu
[考研] 299求调剂 +5 △小透明* 2026-03-17 5/250 2026-03-18 11:49 by 尽舜尧1
[考研] 环境工程调剂 +8 大可digkids 2026-03-16 8/400 2026-03-18 09:36 by zhukairuo
[硕博家园] 湖北工业大学 生命科学与健康学院-课题组招收2026级食品/生物方向硕士 +3 1喜春8 2026-03-17 5/250 2026-03-17 17:18 by ber川cool子
[考研] 材料专硕326求调剂 +6 墨煜姒莘 2026-03-15 7/350 2026-03-17 17:10 by ruiyingmiao
[考研] 290求调剂 +3 p asserby. 2026-03-15 4/200 2026-03-17 16:35 by wangkm
[考研] 东南大学364求调剂 +5 JasonYuiui 2026-03-15 5/250 2026-03-16 21:28 by 木瓜膏
[考研] 一志愿211 0703方向310分求调剂 +3 努力奋斗112 2026-03-15 3/150 2026-03-16 16:44 by houyaoxu
[考研] 070300化学学硕求调剂 +6 太想进步了0608 2026-03-16 6/300 2026-03-16 16:13 by kykm678
[考研] 0856求调剂 +3 刘梦微 2026-03-15 3/150 2026-03-16 10:00 by houyaoxu
[考研] 297求调剂 +4 学海漂泊 2026-03-13 4/200 2026-03-14 11:51 by 热情沙漠
信息提示
请填处理意见