How to do ... in Matlab?

18 views (last 30 days)
Odelia
Odelia on 2 Dec 2013
Moved: Voss on 13 Apr 2024 at 3: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 Comments
Jacob
Jacob on 13 Apr 2024 at 3:06
Moved: Voss on 13 Apr 2024 at 3:13
what is the equivalent of <= in matlab
Voss
Voss on 13 Apr 2024 at 3:13
Moved: Voss on 13 Apr 2024 at 3:13

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!