필터 지우기
필터 지우기

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 CenterFile 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!

Translated by