Plot not showing a line, only individual points(one at a time)?
Show older comments
When I graph my plot, I used the drawnow function and it would plot individual points, then move on to the next without saving the previous point or drawing a line. Any suggestions?
altmax=-inf;
days=10;
dy=-1;
while dy<=days
%--calculate & display current time (UTC)
yr=2018;
mnth=1;
dy=dy+1;
hr=0;
min=0;
sc=0;
d=datetime(yr,mnth,dy,hr,min,sc);
%d=datetime('now');
%--covert and display current time in julian days
JD_TT=juliandate(d);
%--convert julian days to moon position
CooType='q2000';
[X,Y,Z]=moonpos(JD_TT,CooType);
%plot3(X,Y,Z);
%--convert to LLA coordinates, in degrees
alt=sqrt(X.^2+Y.^2+Z.^2);
xplot=dy;
yplot=alt;
plot(xplot,yplot,'-o');
drawnow
end
Accepted Answer
More Answers (0)
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!