quaternion does not work in matlab
古いコメントを表示
I am trying to use rotatepoint and quaternion. when I want to do matlab's example. an error ocurres.
the example is here:
x = 0.5;
y = 0.5;
z = 0;
plot(x,y,"ko")
hold on
axis([-1 1 -1 1])
quat = quaternion([0,0,pi/4; 0,0,-pi/2],"euler","XYZ","point");
rotatedPoint = rotatepoint(quat,[x,y,z])
-------------------------------------------------------------------
this is the error i get:(when using quaternion)
Index exceeds the number of array elements. Index must not exceed 1.
Error in matlabshared.rotations.internal.quaternionBase>partsFromEuler (line 256)
r3 = [arg3(3) arg3(2) arg3(1)];
Error in matlabshared.rotations.internal.quaternionBase>partsFromConversion (line 182)
[qa,qb,qc,qd] = partsFromEuler(arg1,arg2,arg3,arg4);
Error in matlabshared.rotations.internal.quaternionBase (line 59)
[obj.a,obj.b,obj.c,obj.d] = partsFromConversion(varargin{:});
Error in quaternion (line 109)
obj@matlabshared.rotations.internal.quaternionBase(varargin{:});
4 件のコメント
Walter Roberson
2023 年 10 月 12 日
The code works online here.
Which MATLAB release are you using?
Reza Zh
2023 年 10 月 12 日
Dyuman Joshi
2023 年 10 月 12 日
編集済み: Dyuman Joshi
2023 年 10 月 12 日
It could be. Using quaternion() and rotatepoint() requires toolboxes.
MATLAB Online says that one of the following is required for both -
Automated Driving Toolbox
Sensor Fusion and Tracking Toolbox
Navigation Toolbox
Radar Toolbox
Robotics System Toolbox
ROS Toolbox
UAV Toolbox
Computer Vision Toolbox
Check if you have any of the following toolboxes installed by typing "ver" in the command window.
Reza Zh
2023 年 10 月 12 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Localization and Mapping についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
