undefined function or variable error in matlab simulink?

hi.i want to simulate ur10 kinematic(inverse and forward) but when I run I have these errors(screenshot which is attached). the function name or path are correct. i run the trajectory planning block and have all 6 Theta at the output.

9 件のコメント

Ameer Hamza
Ameer Hamza 2018 年 8 月 9 日
From the images it appears that the problem is caused by the function ur10_forward_kinematics(). Are you able to run this function in MATLAB?
Najmeh Eskandari
Najmeh Eskandari 2018 年 8 月 10 日
when I run it there is this error:
not enough input argument but I define theta1,..,6 in simulink
Najmeh Eskandari
Najmeh Eskandari 2018 年 8 月 10 日
i have another Simulink file for SCSRA robot thati is similar to mine and while i running the mfile of it there is the same error(not enough input argument) but when i run Simulink it works.
Najmeh Eskandari
Najmeh Eskandari 2018 年 8 月 10 日
i want to attach Simulink file but i cant.how can i do it?
Ameer Hamza
Ameer Hamza 2018 年 8 月 10 日
It is giving an error because You are not calling it right. Where are you defining theta1,...,6? Also, you need to call it like this
ur10_forward_kinematics(theta1, theta2, theta3, theta4, theta5, theta6)
Also, you can attack the Simulink file by compressing it into a zip file.
Najmeh Eskandari
Najmeh Eskandari 2018 年 8 月 10 日
at Simulink in trajectory planning(it is shown in screenshot I sent)
Najmeh Eskandari
Najmeh Eskandari 2018 年 8 月 10 日
I call it :
[X,Y,Z,T06] = ur10_forward_kinematic(Theta1,Theta2,Theta3,Theta4,Theta5,Theta6,d_1,d_4,d_5,d_6,a_2,a_3)
Ameer Hamza
Ameer Hamza 2018 年 8 月 10 日
It will be easier to suggest a solution if you can attach the model files as zip file.
Najmeh Eskandari
Najmeh Eskandari 2018 年 8 月 10 日
my Simulink file

サインインしてコメントする。

 採用された回答

Ameer Hamza
Ameer Hamza 2018 年 8 月 10 日

0 投票

There are some typing mistakes in ur10_forward_kinematic(). For example in the input list the variable name is Theta2, whereas in the code you are using Theta_2. You need to use the same name in both places. Also on line 39, you are using p06 whereas the actual name is P06 remember the variable names are case sensitive.
The file ur10_inverse_kinematic() contains some more involved problems. For example, at the beginning of your code you are using Theta1, Theta2, ... Theta6 but their values are not defined. You are not giving their values as function input neither defining inside the function. MATLAB has no way of knowing what values to take when the function run.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by