How to do ... in Matlab?

1 回表示 (過去 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
Voss
Voss 2024 年 4 月 13 日
移動済み: Voss 2024 年 4 月 13 日

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by