Implement the body of the function rotationMatrix(),
3 ビュー (過去 30 日間)
古いコメントを表示
function M = rotationMatrix( Size, Shift )
% Generate a square permutation matrix if size Size.
% The permutation is a right rotation - the ROR operation.
% That is the right-multiplication of a row-vector by this matrix performs
% a cyclic shift of vectors positions - the ROR operation.
% The scalar shift specifies how many positions to rotate
% if negative, a ROL operation is performed.
% You cannot use any toolbox functions of cycles,
% just indexing of an identity matrix.
HOW DO THIS? I CANT FIND SOMFTHING FOR THIS
9 件のコメント
Jan
2022 年 11 月 2 日
@Steven Lord: Thanks.
@Ian: Please note that many members of this forum do not speak English natively. Then smart abbreviations are not cool, but confusing.
回答 (1 件)
Image Analyst
2022 年 11 月 3 日
Hint:
v = 1:15
shift = 3;
vShifted = [v(end-shift+1 : end), v(1:end-shift)]
shift = -3;
vShifted = [v(-shift+1 : end), v(1:-shift)]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!