How to change variables in simulink example

1 回表示 (過去 30 日間)
Adam Thompson
Adam Thompson 2020 年 4 月 5 日
回答済み: Harshendra Shah 2020 年 4 月 8 日
HI,
New to MATLAB and Simulink.
Working from the current example:
and I want to edit it slightly!
I want to set my waypoints for the robot trajectory to follow a function f(x) (rather than trace coin boundaries like in the example). I change variables in the command window and then when i sim the simulink file it runs the standard example. I don't see any way to change variables in the simulink workspace. I'm clearly doing something wrong so would appreciate someone shedding some light.
Thanks

回答 (1 件)

Harshendra Shah
Harshendra Shah 2020 年 4 月 8 日
Hi Adam,
You need to open the example using the following command:
openExample('robotics/TrajectoryControlThroughInverseKinematicsExample')
This will open a live script.
Now locate the code section where wayPoints is being updated. That section is on line 36.
You can update this section to use your function code and update the wayPoints variable as you want.
Now run the live script and you should probably get your desired results.
I hope this helps.

カテゴリ

Help Center および File ExchangeCode Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by