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일

1 개 추천

Because of the NaN at the end of the vector. Try this
load test
x(end) =[];
y(end) =[];
fill(x,y,'r')

댓글 수: 3

alexandre xavier
alexandre xavier 2013년 12월 12일
Thanks. I was loosing lot of time is this question
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
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개)

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

제품

태그

질문:

2013년 12월 11일

댓글:

2020년 11월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by