not enough input arguments error
Mostra commenti meno recenti
function T = trans( a, d,alpha, theta)
%Describing the Denavit-Hartenberg parameters
T =[cosd(theta) -(sind(theta)) 0 a;
sind(theta)*cosd(alpha) cosd(theta)*cosd(alpha) -sind(alpha) -d*sind(alpha);
sind(theta)*sind(alpha) sind(alpha)*cosd(theta) cosd(alpha) d*cosd(alpha);
0 0 0 1 ];
end
at line 3 im getting not enough input arguments
Risposte (1)
Geoff Hayes
il 23 Mar 2021
sudheer - if you are calling this function from the command line (or another piece of code) as simply
trans
then you will get this error. The function signature
function T = trans( a, d,alpha, theta)
is telling you that you need to provide four input paramters: a, d, alpha and theta. And so the function should be called like
trans(1,0.5,45,-74)
The above inputs are for example only...I don't know what the units for the inputs should be.
5 Commenti
sudheer yadav
il 23 Mar 2021
Geoff Hayes
il 23 Mar 2021
sudheer - you will need to show the code that you are using and the full error message.
Steven Lord
il 23 Mar 2021
Can you show us exactly how you're calling your function and the full and exact text of the error message you receive (all the text displayed in red, and if there is any all the text displayed in orange) when you try to call it?
sudheer yadav
il 23 Mar 2021
I do not observe any error when used in the manor that Geoff suggested.
trans(1,0.5,45,-74)
function T = trans( a, d,alpha, theta)
T =[cosd(theta) -(sind(theta)) 0 a;
sind(theta)*cosd(alpha) cosd(theta)*cosd(alpha) -sind(alpha) -d*sind(alpha);
sind(theta)*sind(alpha) sind(alpha)*cosd(theta) cosd(alpha) d*cosd(alpha);
0 0 0 1 ];
end
Categorie
Scopri di più su Vector Volume Data in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!