フィルターのクリア

not enough input arguments

3 ビュー (過去 30 日間)
maria serey-roman
maria serey-roman 2020 年 5 月 6 日
コメント済み: maria serey-roman 2020 年 5 月 9 日
Im new to MATLAB and im having trouble creating a simple function.
When I call the function:
a = [268.32,0, 120,0,240];
[T] = transformation_matrix(a);
I keep getting "not enough input arguments" and error on line 3.
How can i fix this?
function [T] = transformation_matrix(l,x1,x2,y1,y2)
costheta = (x2-x1)/l;
sintheta = (y2-y1)/l;
t = [costheta sintheta 0 0 0 0;
-sintheta costheta 0 0 0 0;
0 0 1 0 0 0;
0 0 0 costheta sintheta 0;
0 0 0 -sintheta costheta 0;
0 0 0 0 0 1];
end

回答 (2 件)

Cris LaPierre
Cris LaPierre 2020 年 5 月 7 日
You have written the function to accept 5 inputs: l,x1,x2,y1,y2
However, when you call it, you are only using one: a, which gets assigned to l.
I think what you want to do instead is
T = transformation_matrix(268.32,0, 120,0,240);
  1 件のコメント
maria serey-roman
maria serey-roman 2020 年 5 月 9 日
yes this is what i ended up doing! thank you!

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


madhan ravi
madhan ravi 2020 年 5 月 7 日
a = [268.32,0, 120,0,240];
a = num2cell(a)
T = transformation_matrix(a{:});
  1 件のコメント
maria serey-roman
maria serey-roman 2020 年 5 月 9 日
thank you

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by