Graph in 3D Matlab
显示 更早的评论
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
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
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
2017-2-19
编辑:Image Analyst
2017-2-19
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!