Why fill function doesn't work?

39 次查看(过去 30 天)
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