Simulink: Specifying trajectory
I would like to use jtraj to specify a tra开发者_开发问答jectory in a Simulink model. Below are what I attempted to retrieve in the command prompt:
Q0 = [1 1 0];
Q1 = [1+0.5*cos(2*20) 1+0.5*sin(2*20) 0];
t = 0:0.1:20;
[Q, Qd, Qdd] = jtraj(Q0, Q1, t);
However, I don't know how to include such trajectory data in the Simulink model easily. Any comments?
Thanks in advance.
If I understand your question correctly, you want to import some time-dependent data as a signal in a Simulink model, correct? There are two ways you can do this,
- Using a root inport, and then importing the data using the Input field on the Data Import/Export page of the configuration parameters. See the documentation for more information.
- Use a From Workspace block to import the data from the base workspace.
i think there is some ways: you can write your data to m-file (for example by test.m name) then befor running simulink model, you can run this m-file, in this case you can use Constant block whit variable's name that exists to workspace.
精彩评论