put a mall matrix in a big matrix

Helll everybody,
A = zeros(672,34953);
I want to put a quadratic matrix (672,672) B, beginning at this spot (1,5377)
anybody has any idea how can i implement it quickly and efficiently ?
Thanks

 採用された回答

Jan
Jan 2013 年 10 月 24 日

0 投票

A( 1: 1 + size(B,1)-1, 5377 : 5377 + size(B, 2) - 1 ) = B;

6 件のコメント

Michael
Michael 2013 年 10 月 24 日
quick answer, quick solution. Thanks a lot
Jan
Jan 2013 年 10 月 24 日
編集済み: Jan 2013 年 10 月 24 日
You are welcome.
By the way: you may want to mark answers as 'accepted answer', if they helped you solve your problem.
Michael
Michael 2013 年 10 月 24 日
is there a quick efficient solution as well for 2 similar little matrices ? like in spot (1,5377) and (1, 25347) ?
Jan
Jan 2013 年 10 月 24 日
Very similar to the answer I gave you before. You will only have to adapt the spot indices.
Michael
Michael 2013 年 10 月 24 日
so 2 lines for 2 matrices ?
John D'Errico
John D'Errico 2013 年 10 月 24 日
Why is that a problem? If you really have something specific you are trying to solve, then ask a direct question.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2013 年 10 月 24 日

コメント済み:

2013 年 10 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by