reshaping
古いコメントを表示
i have A= 1 0 1 0 0 0 1 and B= 1 1 1 0 0 0 1 now i need to make it as s= 1 1 0 1 1 1 0 0 0 0 0 0 1 1 can any please help me
採用された回答
その他の回答 (1 件)
Sean de Wolski
2011 年 6 月 23 日
s= zeros(1,numel(A)+numel(B))
s(2:2:end) = B;
s(1:2:end) = A;
?
5 件のコメント
mahaveer hanuman
2011 年 6 月 23 日
Walter Roberson
2011 年 6 月 23 日
s = horzcat(A,B);
or alternately
s = [A,B];
Matt Fig
2011 年 6 月 23 日
The s shown in the example is not a simple concatenation.
Walter Roberson
2011 年 6 月 23 日
But the solution you gave below is the same effectively solution as Sean already gave, which Mahaveer was replying to. I took Mahaveer's "now i need" as indicating Mahaveer needed something _different_ now.
Matt Fig
2011 年 6 月 23 日
Oh, I took it as that he didn't understand Sean de's solution because he had it in his mind that there was going to be some 'reshaping' done...
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!