for ex i have sequences A=[1 2 3 4]
B=[1 2 ]
i want to add the zeros in the B sequence by comparing the length..

1 件のコメント

krithika P
krithika P 2012 年 7 月 11 日
how to add.. is there any inbuilt command

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

 採用された回答

Conrad
Conrad 2012 年 7 月 11 日

0 投票

Did you mean something like this?
A = [1 2 3 4];
B = [1 2];
B = [B zeros(1,length(A)-length(B))];
B will then be equal to [1 2 0 0].

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Elementary Math についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by