フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

hi every one, how can I model a moving train scenario that move linearly from point 1 to point 2 within a communication cell any one have information about that ? please I need your help

2 ビュー (過去 30 日間)
wael ali
wael ali 2015 年 12 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
high speed railways

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 12 月 10 日
Ummm,
xpositions = linspace(start_x, end_x, number_of_points);
ypositions = linspace(start_y, end_y, number_of_points);
?
  2 件のコメント
wael ali
wael ali 2015 年 12 月 11 日
thanks for your response but what do you mean by the number of points
Walter Roberson
Walter Roberson 2015 年 12 月 11 日
If you wanted there to be 11 points along the way then number_of_points would be 11 (including the endpoints).
For example, if the x and y are indicated in km coordinates
dist = sqrt((start_x - end_x).^2 + (start_y - end_y).^2); %in km
desired_velocity = 83.415; %km/h
num_hour = dist ./ desired_velocity;
steps = 16;
number_of_points = steps+1;
timestep = num_hour / steps;
xpositions = linspace(start_x, end_x, number_of_points);
ypositions = linspace(start_y, end_y, number_of_points);
Then xpositions(K) corresponds to having been under way for (K-1)*timestep and having traveled (K-1)/steps * dist
You should be able to easily reformulate in terms of fixed amount of time between points, or in terms of fixed distance between points.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by