フィルターのクリア

loop FOR to group discrete signals

1 回表示 (過去 30 日間)
studentU
studentU 2015 年 6 月 20 日
コメント済み: Star Strider 2015 年 6 月 21 日
Hi every one;
with this simply code:
for i=1:5
a=2*i;
b=[];
b=[b;a];
end
i have: >> b=10;
i want to modify the code to have in the result:
>> b=[2;4;6;8;10];
can u help me, it's importante for me, to generalize 't with my programme.
thank's.

回答 (1 件)

Star Strider
Star Strider 2015 年 6 月 20 日
Just put your ‘b’ initilisation before the loop:
b=[];
for i=1:5
a=2*i;
b=[b;a];
end
  2 件のコメント
studentU
studentU 2015 年 6 月 20 日
oh! yes, okey; thank's for ure repply
Star Strider
Star Strider 2015 年 6 月 21 日
My pleasure!
I would of course appreciate it if you would Accept my Answer.

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

カテゴリ

Help Center および File ExchangeGet Started with Signal Processing Toolbox についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by