필터 지우기
필터 지우기

Why fill function doesn't work?

조회 수: 39 (최근 30일)
alexandre xavier
alexandre xavier 2013년 12월 11일
댓글: Alexandre Xavier 2020년 11월 16일
Dear folks, I am trying to fill polygons, but the fill function does not working. Does any body know if this function have limitations for the number of points? My code is:
load test
fill(x,y,'r')
Thanks,
Alexandre

채택된 답변

the cyclist
the cyclist 2013년 12월 12일
Because of the NaN at the end of the vector. Try this
load test
x(end) =[];
y(end) =[];
fill(x,y,'r')
  댓글 수: 3
Doganay Karatas
Doganay Karatas 2020년 11월 14일
Error using fill
Not enough input arguments.
Why do i get this error??
HERE IS MY CODE
t=0:pi/50:2*pi;
figure(1)
plot(t,sin(t))
figure (2)
fill (t,sin(t)),('g')
figure (3)
stairs (t,sin(t))
figure (4)
bar (t,sin(t))
end
Alexandre Xavier
Alexandre Xavier 2020년 11월 16일
This will work
t=0:pi/50:2*pi;
figure(1)
plot(t,sin(t))
figure(2)
fill(t, sin(t), 'r')
figure(3)
stairs(t,sin(t), 'r')
figure(4)
bar(t,sin(t))

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

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by