Algorithm之MC:基于Matlab实现通过蒙特卡洛方法模拟二维布朗运动
生活随笔
收集整理的這篇文章主要介紹了
Algorithm之MC:基于Matlab实现通过蒙特卡洛方法模拟二维布朗运动
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Algorithm之MC:基于Matlab實(shí)現(xiàn)通過(guò)蒙特卡洛方法模擬二維布朗運(yùn)動(dòng)
?
?
目錄
輸出結(jié)果
設(shè)計(jì)代碼
?
?
?
輸出結(jié)果
基于Matlab實(shí)現(xiàn)通過(guò)蒙特卡洛方法模擬二維布朗運(yùn)動(dòng)
?
?
設(shè)計(jì)代碼
%基于Matlab實(shí)現(xiàn)通過(guò)蒙特卡洛方法模擬二維布朗運(yùn)動(dòng) function [x,y,m,n]=br2(x0,xf,y0,yf,h) x=x0:h:xf; y=y0:h:yf; a=randn(size(x)); b=randn(size(y)); m(1)=0; n(1)=0;for k=1:length(x)-1; m(k+1)=m(k)+a(k); n(k+1)=n(k)+b(k); end;%再在命令窗口鍵入x0=0; xf=10; h=0.01; y0=0; yf=10; [x,y,m,n]=br2(x0,xf,y0,yf,h); plot(m,n) xlabel('m'); ylabel('n')?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的Algorithm之MC:基于Matlab实现通过蒙特卡洛方法模拟二维布朗运动的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Algorithm之MC:Monte C
- 下一篇: Algorithm之PrA:PrA之nL