Plot keeps coming up empty

조회 수: 1 (최근 30일)
Jenny Briggs
Jenny Briggs 2016년 3월 10일
댓글: Rena Berman 2017년 1월 20일
Hi, I am trying to plot a graph, but my graph keeps coming up empty without any plots.
My code is below and I would appreciate it greatly if anyone could spot where I've gone wrong.
Thanks
hold on;
for i = 0:5
th = 0:pi/50:2*pi;
xv = i * cos(th); % for given value R
yv = i * sin(th); % R is the radius of the circle
rng default
xq = -1000:1000;
yq = -1000:1000;
[X,Y] = meshgrid(yq,xq);
[in,on] = inpolygon(X,Y,xv,yv);
Y = numel(X(in), Y(in))
E = abs(Y-pi*i^2)
plot(i, E)
grid on
end
hold off
  댓글 수: 1
Rena Berman
Rena Berman 2017년 1월 20일
(Answers Dev) Restored Question.

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 3월 10일
plot(i, E, '*')
You are plotting one point at a time so you have no connecting lines. The default is no marker.
  댓글 수: 1
Jenny Briggs
Jenny Briggs 2016년 3월 10일
Brilliant! Thank you so much!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by