Simulate 99 signals of with random phase of a real EEG signal

2 Ansichten (letzte 30 Tage)
Pamela Mesa Cabrera
Pamela Mesa Cabrera am 20 Mai 2019
Kommentiert: Image Analyst am 20 Mai 2019
We need to simulate 99 random signals with the Monte Carlo method, and we have this code. Could you help us please to analyze each line of this code.
for i=1:M
delta=rand(1,fix((N-1)/2))*2*pi;
d_real=rand(1,2);
d_real=(d_real>0.5)*pi;
if rem(N,2) % even or odd N?
out=[d_real(1),delta,-fliplr(delta)];
else
out=[d_real(1),delta,d_real(2),-fliplr(delta)];
end
end
Delta is the signal in the time domain.
  1 Kommentar
Image Analyst
Image Analyst am 20 Mai 2019
Since no one has answered, why don't you just look up each of the functions in the help? rand(), fix(), fliplr(), and rem(). That will give you a start on understanding this code. Can't you ask the author of the code?

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