How to do ... in Matlab?

4 次查看(过去 30 天)
Odelia
Odelia 2013-12-2
移动Voss 2024-4-13
Hello,
I need to know how to do few things in Matlab. It would be easier to show you the whole code, i need to do what is written in the lines that start by % (except for %dW, for the moment at least).
Here is the code i'm working on:
N = 10;
t = 1:N;
d = 3;
R = 2*pi*rand(6);
for i = 1:6
for j = 1:6
W(i,j) = 6*(i-1) + j;
nc = %integer of W(i,j) + 2
%dW = differences in W
for dt = 1:length(t);
g(etha) = exp(-(etha^2) / (2*dt)) / (2*pi*dt)^(d/2);
R = R + etha * sqrt(2*1/2*dt);
W = W * exp(-dW * dt);
end
if W(i,j) > 1 && nc >= 2
% create nc copies of R(i,j) of which W = W-1
elseif W(i,j) < 1
% delete R(i,j) of which W = 1-W
end
end
end
In addition, g(etha) is supposed to be a probability density, and the etha that goes out from it is this i have to insert in R (the line after g(etha)). Does anybody know how i have to set this?
Thank you very much,
  2 个评论
Jacob
Jacob 2024-4-13
移动:Voss 2024-4-13
what is the equivalent of <= in matlab

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by