フィルターのクリア

Event base simulation in matlab

2 ビュー (過去 30 日間)
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 6 月 11 日
コメント済み: Abhishek M 2014 年 6 月 13 日
Hi, I don't know how to do event based simulation in matlab. Just need a start for it, this question is a start part of my bigger task.
i have this,
arrival_departure_frequency =
0.0000 5.9489 0
0.0000 6.6353 0
0.0001 6.9292 0
0.0001 6.9361 0
0.0001 7.2979 0
0.0001 7.7989 0
0.0002 7.9419 0
0.0002 8.8358 0
0.0002 8.8383 0
0.0002 9.0600 0
First column is my event_arrivals and the 2nd column is event_departure. I want to change the value of third column from 0 to 1 when the simulation is in between arrival time and the departure time.
Once the event_departure arrives it again back set to O. Thank you so much.
  27 件のコメント
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 6 月 12 日
Hi, I just managed what i wanted to achieve. Thank you so much dear. i really appreciate your time and support. Take care......
Abhishek M
Abhishek M 2014 年 6 月 13 日
Cool.. I saw your recent query. That question seems to be more clear than this. Anyways good to know you got your solution.
Cheers.

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

採用された回答

Abhishek M
Abhishek M 2014 年 6 月 11 日
Hi Aftab, I insist you to use stateflow for this logic. You can create your events and trigger the output based on your logic.
  3 件のコメント
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 6 月 11 日
Hello, i have tried up to this point but how can i introduce the departure time with it.
for i =1:10
timenow = event_arrivals(i);
no_channels = find(BS_channeltable == 0);
first_available = min(no_channels);
if timenow == (event_arrivals(i))&& (first_available ~=0)
BS_channeltable(first_available)=1;
end
end
Please help me with it.
Aftab Ahmed Khan
Aftab Ahmed Khan 2014 年 6 月 11 日
編集済み: Aftab Ahmed Khan 2014 年 6 月 11 日
Hi,
I have managed up to this point but how can i release the channel from it as it will never reach to the departure time of the files.
for i =1:10
timenow = event_arrivals(i);
no_channels = find(BS_channeltable == 0);
first_available = min(no_channels);
%%Allocating the Channel on the file arrival
if timenow == (event_arrivals(i))&&(first_available ~=0)
BS_channeltable(first_available) = 1;
fprintf(fid,'Frequency is assigned.\n');
Releasing the channel on file departure
elseif timenow == event_departures(i)
release_channel = find(BS_channeltable==1);
last_occuped = max(release_channel);
BS_channeltable(last_occuped) = 0;
fprintf(fid,'Frequency is released.\n');
end
end
and how can i get my simulation to the departure time?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by