I would like to present a Brownian motion figure (t, W (t)) in dimension 3, so as to have the x and y axes representing the time t and the z axis representing the brownian motion W (t). Here is the code I used in dimension 2 :
tf=350; % Set time interval [0,tf]
N=350; % Set number of steps to compute at in [0,tf]
h=tf/N; % Compute the time step
dW=sqrt(h)*randn(1,N); % Generate array of brownian movements
W=cumsum(dW); % Sum the array cummulativley
t=0:h:tf; % Array of equal time steps
plot(W); % Plot the Wiener process
xlabel('t');ylabel('W(t)');title('Sample Wiener Process')

댓글 수: 4

Star Strider
Star Strider 2017년 2월 18일
‘... so as to have the x and y axes representing the time t ...’
I’m obviously missing somthing.
What is to be gained by having the same variable represented on two axes of a 3D plot?
John BG
John BG 2017년 2월 19일
Magdalin
the answer you probably want is the same that Start Strider provided to Raady in this QA:
let know if that solves this question
regards
Magdalin
Magdalin 2017년 2월 19일
편집: Image Analyst 2017년 2월 19일
I know that this is a 2-dimension plot, but I just want to know how I can change my code to have a 3D view of this 2D plot just like this:
Image Analyst
Image Analyst 2017년 2월 19일
I gave you random walk code below. The thing we're all confused about is how you have two axes (x and y) for time ("have the x and y axes representing the time t ") while the particle travels in only one direction - the z direction. Explain why there are two time axes.

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2017년 2월 19일

0 개 추천

Seems like a random walk program should do it. I'm attaching 3 different random walk simulations. Feel free to modify any of them.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2017년 2월 18일

댓글:

2017년 2월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by