필터 지우기
필터 지우기

Using multiple functions in combination

조회 수: 1 (최근 30일)
James Connor
James Connor 2015년 10월 20일
편집: James Connor 2015년 10월 21일
edit

채택된 답변

dpb
dpb 2015년 10월 20일
Looks to me like it would just be
ring(t,nstars,ringradius,npoints,R,r)
if you remove the lines within ring that redefine the input arguments ringradius and nstars (and any others I overlooked). star gets called within ring w/o any other effort required other than either being visible in MATLABPATH or an internal function within ring.m
function turtle=ring(t,nstars,ringradius,npoints,R,r)
t2=Turtle();
turnAngle=0;
for k=1:nstars
...
  댓글 수: 2
James Connor
James Connor 2015년 10월 20일
I think I made an error on my code, on the ring function when I try to run it when it gets to the star part of of the code it just draws the star normally like it was the star() function and ignores the ring() parts
dpb
dpb 2015년 10월 20일
Since we can't run your code a little tough to tell but...I wonder if there's an issue w/ Turtle in some context presumed to be shared somehow that isn't? Since we have no klew what's in there, it's just a guessing game...

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by