Trajectory designing Matlab code

1 次查看(过去 30 天)
Bilal sadiq
Bilal sadiq 2018-6-26
Hi Dear all i want to make a trajectory path which i have done but i am unable to get the output in simulink please help me fast what mistake i am doing????
function [a3,a2,a1,a0]= TrajCreate(theta0,thetaf,thetad0,thetadf,t)
T=20;
a0 = theta0;
a1 = thetad0;
a2 = (-3 * (theta0 - thetaf) - (2 * thetad0+thetadf )*T)/ T ^ 2;
a3 = (2 * (theta0 - thetaf) + (thetad0+thetadf )*T)/ T ^ 3;
end
% Run File theta0=10; thetaf=50; thetad0=0; thetadf=0;
[a3,a2,a1,a0]=TrajCreate(theta0,thetaf,thetad0,thetadf)
p=[a3 ,a2 , a1 , a0];
t=linspace(0,20,100);
Pos=polyval(p,t)
plot(t,Pos)
This give me nice result but i want the Pos my output in simulink
can you some one please help me
thanks in advance

回答(3 个)

Ameer Hamza
Ameer Hamza 2018-6-26
You can use From Workspace block to transfer trajectory signal data from MATLAB base workspace to Simulink.

Bilal sadiq
Bilal sadiq 2018-6-26
I have already done that but unable to get that Well I am not a newbie to matlab I know all these basics Please provide me some example
  5 个评论
Bilal sadiq
Bilal sadiq 2018-6-27
The file you attached is not working

请先登录,再进行评论。


Bilal sadiq
Bilal sadiq 2018-6-27
how can i run the file ?when i open your .mdl file it open like some .txt file format and it is not getting download
  2 个评论
Ameer Hamza
Ameer Hamza 2018-6-27
Right-click on the file name and press Save Link as. Also instead of starting a new answer, it is better to keep comment on the original answer. It helps keep track of the things.
Bilal sadiq
Bilal sadiq 2018-6-27
I have windows 10 it is not showing save link as............... instead it is showing Save linked content as................ and i have tried it is not working

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by