フィルターのクリア

a=1 2 3 4 5 6 7 8 9 b=0 1 1 2 3 2 3 2 1 resultant matrix is 1 0 2 1 3 1 4 2 5 3 6 2 7 3 8 2 9 1

4 ビュー (過去 30 日間)
kavitha subramaniam
kavitha subramaniam 2014 年 10 月 27 日
編集済み: Matt J 2014 年 10 月 27 日
a=1 2 3
4 5 6
7 8 9
b=0 1 1
2 3 2
3 2 1
How do I interleave columns?
resultant matrix is 1 0 2 1 3 1
4 2 5 3 6 2
7 3 8 2 9 1
  1 件のコメント
Matt J
Matt J 2014 年 10 月 27 日
編集済み: Matt J 2014 年 10 月 27 日
This appears to be essentially the same as your earlier post
an Answer to which you accepted. Please clarify how this is new.

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

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 10 月 27 日
a=[1 2 3; 4 5 6; 7 8 9]
b=[0 1 1; 2 3 2; 3 2 1]
[n,m]=size(a)
c=zeros(n,2*m)
c(:,1:2:end)=a
c(:,2:2:end)=b

Jan
Jan 2014 年 10 月 27 日
a = [1 2 3; 4 5 6; 7 8 9];
b = [0 1 1; 2 3 2; 3 2 1];
c = reshape([a; b], 3, 6)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by