loop FOR to group discrete signals
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Signal Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!