24小时热门版块排行榜    

查看: 664  |  回复: 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材料科学与工程学硕,总分289分 +3 @taotao 2026-03-19 3/150 2026-03-19 14:07 by peike
[考研] 化学求调剂 +3 临泽境llllll 2026-03-17 4/200 2026-03-19 13:59 by houyaoxu
[考研] 346求调剂[0856] +3 WayneLim327 2026-03-16 6/300 2026-03-19 11:21 by WayneLim327
[考研] 0703化学调剂,求各位老师收留 +10 秋有木北 2026-03-14 10/500 2026-03-19 05:52 by anny19840123
[考研] 材料工程专硕调剂 +5 204818@lcx 2026-03-17 6/300 2026-03-18 22:55 by 204818@lcx
[考研] 085700资源与环境308求调剂 +3 墨墨漠 2026-03-18 3/150 2026-03-18 22:35 by bingxueer79
[考研] 312求调剂 +8 陌宸希 2026-03-16 9/450 2026-03-18 12:39 by Linda Hu
[考研] 280求调剂 +6 咕噜晓晓 2026-03-18 7/350 2026-03-18 11:25 by 无际的草原
[考研] 0703化学336分求调剂 +6 zbzihdhd 2026-03-15 7/350 2026-03-18 09:53 by zhukairuo
[考博] 26博士申请 +3 1042136743 2026-03-17 3/150 2026-03-17 23:30 by 轻松不少随
[考研] 211本,11408一志愿中科院277分,曾在中科院自动化所实习 +6 Losir 2026-03-12 7/350 2026-03-17 12:09 by danranxie
[基金申请] 今年的国基金是打分制吗? 50+3 zhanghaozhu 2026-03-14 3/150 2026-03-16 17:07 by 北京莱茵润色
[考研] 070303 总分349求调剂 +3 LJY9966 2026-03-15 5/250 2026-03-16 14:24 by xwxstudy
[考研] 277材料科学与工程080500求调剂 +3 自由煎饼果子 2026-03-16 3/150 2026-03-16 14:10 by 运气yunqi
[考研] 326求调剂 +3 mlpqaz03 2026-03-15 3/150 2026-03-16 07:33 by Iveryant
[考研] 0856专硕279求调剂 +5 加油加油!? 2026-03-15 5/250 2026-03-15 11:58 by 2020015
[考研] 22408总分284求调剂 +3 InAspic 2026-03-13 3/150 2026-03-15 11:10 by zhq0425
[考研] 070305求调剂 +3 mlpqaz03 2026-03-14 4/200 2026-03-15 11:04 by peike
[考研] 中科大材料与化工319求调剂 +3 孟鑫材料 2026-03-14 3/150 2026-03-14 20:10 by ms629
[考研] 295求调剂 +3 小匕仔汁 2026-03-12 3/150 2026-03-13 15:17 by vgtyfty
信息提示
请填处理意见