フィルターのクリア

I am having trouble understand what this command does. Can anyone help me?

1 回表示 (過去 30 日間)
S
S 2014 年 10 月 27 日
編集済み: Chad Greene 2014 年 10 月 27 日
reshape(repmat([1 2],2,2),1,[])
I know repmat replicates the matrix and reshape reshapes the matrix, but what does it replicate and reshape. So far I think repmat([1 2],2,2) repeats the [1 2] matrix so its a 2x2 matrix. But the reshape part confuses me.

採用された回答

Chad Greene
Chad Greene 2014 年 10 月 27 日
編集済み: Chad Greene 2014 年 10 月 27 日
Let's give the matrix we're operating on [1 2] a name. Let's say
A = [1 2];
Then repmat repeats A in a two-by-two arrangement:
repmat(A,2,2)
ans =
1 2 1 2
1 2 1 2
Then reshape it into a 1-by-however-wide-it-needs-to-be matrix:
reshape(ans,1,[])
ans =
1 1 2 2 1 1 2 2

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by