restart
最初からドライビング シナリオ シミュレーションを再実行
説明
例
25 メートルの直線道路を車両が秒速 20 メートルで走行するドライビング シナリオを作成します。シナリオをプロットします。
scenario = drivingScenario('SampleTime',0.1);
roadcenters= [0 0 0; 25 0 0];
road(scenario,roadcenters)ans =
Road with properties:
Name: ""
RoadID: 1
RoadCenters: [2×3 double]
RoadWidth: 6
BankAngle: [2×1 double]
Heading: [2×1 double]
v = vehicle(scenario,'ClassID',1); waypoints = [5 0 0; 20 0 0]; speed = 20; % m/s smoothTrajectory(v,waypoints,speed) plot(scenario)

シミュレーションを実行し、各タイム ステップにおける車両の位置を表示します。
while advance(scenario) fprintf('Vehicle location: %0.2f meters at t = %0.0f ms\n', ... v.Position(1), ... scenario.SimulationTime * 1000) end
Vehicle location: 7.00 meters at t = 100 ms Vehicle location: 9.00 meters at t = 200 ms Vehicle location: 11.00 meters at t = 300 ms Vehicle location: 13.00 meters at t = 400 ms Vehicle location: 15.00 meters at t = 500 ms Vehicle location: 17.00 meters at t = 600 ms Vehicle location: 19.00 meters at t = 700 ms

シミュレーションを再実行します。サンプル時間を長くし、シミュレーションを再実行します。
restart(scenario); scenario.SampleTime = 0.2; while advance(scenario) fprintf('Vehicle location: %0.2f meters at t = %0.0f ms\n', ... v.Position(1), ... scenario.SimulationTime * 1000) end
Vehicle location: 9.00 meters at t = 200 ms Vehicle location: 13.00 meters at t = 400 ms Vehicle location: 17.00 meters at t = 600 ms

入力引数
ドライビング シナリオ。drivingScenario オブジェクトとして指定します。
バージョン履歴
R2017a で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)