The code below explains program to evaluate a 2x2 rotation matrix for given input angle.The code seems to be fine for all elements but one in1st row and second column.Can't figure out where I'm wrong.
古いコメントを表示
function [ var ] = rot( theta )
for j=1:2,
for i=j:2,
if (i==j)
var(i,j) = cosd(theta);
elseif (i-j>0)
var(i,j) = sind(theta);
else
var(i,j) = -sind(theta);
end
end
end
var;
end
The problem, is with var(1,2) which always displays a zero irrespective of angle value.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Graphics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!