Filter löschen
Filter löschen

How to do ... in Matlab?

4 Ansichten (letzte 30 Tage)
Odelia
Odelia am 2 Dez. 2013
Verschoben: Voss am 13 Apr. 2024
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 Kommentare
Jacob
Jacob am 13 Apr. 2024
Verschoben: Voss am 13 Apr. 2024
what is the equivalent of <= in matlab
Voss
Voss am 13 Apr. 2024
Verschoben: Voss am 13 Apr. 2024

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by