what is the meaning of following code?

10 ビュー (過去 30 日間)
Md.Simul Hasan Talukder
Md.Simul Hasan Talukder 2019 年 1 月 28 日
回答済み: Image Analyst 2019 年 1 月 28 日
function [shift_rows_out] = shift_rows_fun (shift_rows_in)
idx = [1 2 3 4 6 7 8 5 11 12 9 10 16 13 14 15];
shift_rows_out = shift_rows_in(:, idx);

回答 (2 件)

madhan ravi
madhan ravi 2019 年 1 月 28 日

Image Analyst
Image Analyst 2019 年 1 月 28 日
It extracts columns 1 2 3 4 6 7 8 5 11 12 9 10 16 13 14 and 15, in that order, from matrix "shift_rows_in" and puts the result into a new matrix called "shift_rows_out".
The colon in (:, idx) literally means "ALL rows" and the idx means indexes and since it's the second argument it means the column indexes specified by the poorly-named idx variable.

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by