Index in position 2 exceeds array bounds (must not exceed 1).?
2 ビュー (過去 30 日間)
古いコメントを表示
hello
i made code
t=robot.fkine( th1 th2 th3);
g= t(1,4);
then show error
Index in position 2 exceeds array bounds (must not exceed 1).
how i can solve it
6 件のコメント
回答 (2 件)
Star Strider
2022 年 3 月 28 日
I am not certain what ‘t’ is.
However it appears to be a column vector, so the second index is not appropriate for it.
t = rand(5,1)
g = t(1,1)
g = t(1,4)
.
4 件のコメント
Star Strider
2022 年 3 月 29 日
The error indicates that is not reality.
However I get the feeling that this could require the Robotics Toolbox or some other function I don’t have.
Image Analyst
2022 年 3 月 28 日
編集済み: Image Analyst
2022 年 3 月 28 日
What does this show:
t = robot.fkine(th1 th2 th3);
size(t) % Do NOT use a semicolon here!
g = t(1, 4);
If t is an N-by-1 column vector, try
g = t(4);
Actually that should work for either a row vector or a column vector.
7 件のコメント
参考
カテゴリ
Help Center および File Exchange で Robotics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!