필터 지우기
필터 지우기

my for loops do not work

조회 수: 1 (최근 30일)
shiva
shiva 2014년 10월 13일
댓글: Star Strider 2014년 10월 13일
hello, my for loops do not seem to work.I appreciate if anyone could help me with that.
clear all;
m=500;
n=50;
G=zeros(m,n);
G(250,1)=1;
S(1,1)=1;
for i=2:1:300
sol=roots([1 -S(i-1,1) -1]);
S(i,1)=sol(sol>=0);
end
S=10*(S);
y=ceil(S);
y(1,1)=1;
G(250,1)=1;
G(250+y(1,1),1)=1;
for t=1:1:50
for k=50:1:1
if y(t+50-k,1)<=250
for j=1:1:y(t+50-k,1)
G(250+j,k)=1;
G(250-j,k)=1;
end
end
end
end

채택된 답변

Star Strider
Star Strider 2014년 10월 13일
What does ‘do not seem to work’ mean? Your code runs without errors.
What do you want your for loops to do?
  댓글 수: 12
Image Analyst
Image Analyst 2014년 10월 13일
I also have a little movie making demo that you may be interested in - it's attached.
Star Strider
Star Strider 2014년 10월 13일
@ I A — Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by