24小时热门版块排行榜    

查看: 668  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 材料080500调剂求收留 +5 一颗meteor 2026-03-13 5/250 2026-03-20 09:14 by xingguangj
[考研] 0817 化学工程 299分求调剂 有科研经历 有二区文章 +20 rare12345 2026-03-18 20/1000 2026-03-20 08:42 by 无际的草原
[考研] 求调剂 +3 暗涌afhb 2026-03-16 3/150 2026-03-20 00:28 by 河南大学校友
[考研] 266求调剂 +5 阳阳哇塞 2026-03-14 10/500 2026-03-19 15:08 by 阳阳哇塞
[考研] 本人考085602 化学工程 专硕 +17 不知道叫什么! 2026-03-15 19/950 2026-03-19 15:06 by 尽舜尧1
[考研] 332求调剂 +3 ydfyh 2026-03-17 3/150 2026-03-19 10:14 by 功夫疯狂
[考研] 330求调剂 +3 小材化本科 2026-03-18 3/150 2026-03-18 21:55 by 无懈可击111
[考研] 070300化学319求调剂 +6 锦鲤0909 2026-03-17 6/300 2026-03-18 13:22 by Iveryant
[考研] 304求调剂 +12 小熊joy 2026-03-14 13/650 2026-03-18 12:34 by Linda Hu
[考研] 280求调剂 +6 咕噜晓晓 2026-03-18 7/350 2026-03-18 11:25 by 无际的草原
[考研] 0703化学求调剂 总分331 +3 ZY-05 2026-03-13 3/150 2026-03-18 10:58 by macy2011
[基金申请] 被我言中:新模板不强调格式了,假专家开始管格式了 +4 beefly 2026-03-14 4/200 2026-03-17 22:04 by 黄鸟于飞Chao
[考研] 考研求调剂 +3 橘颂. 2026-03-17 4/200 2026-03-17 21:43 by 有只狸奴
[考研] 326求调剂 +5 上岸的小葡 2026-03-15 6/300 2026-03-17 17:26 by ruiyingmiao
[考研] 一志愿苏州大学材料工程(085601)专硕有科研经历三项国奖两个实用型专利一项省级立项 +6 大火山小火山 2026-03-16 8/400 2026-03-17 15:05 by 无懈可击111
[考研] 材料工程专硕274一志愿211求调剂 +6 薛云鹏 2026-03-15 6/300 2026-03-17 11:05 by 学员h26Tkc
[考研] 283求调剂 +3 听风就是雨; 2026-03-16 3/150 2026-03-17 07:41 by 热情沙漠
[考研] 304求调剂 +4 ahbd 2026-03-14 4/200 2026-03-16 16:48 by 我的船我的海
[考研] 277材料科学与工程080500求调剂 +3 自由煎饼果子 2026-03-16 3/150 2026-03-16 14:10 by 运气yunqi
[考研] 一志愿哈工大材料324分求调剂 +5 闫旭东 2026-03-14 5/250 2026-03-14 14:53 by 木瓜膏
信息提示
请填处理意见