make dot and count them
1 次查看(过去 30 天)
显示 更早的评论
how to make dots (points) in an axes and count them.. may I use "ginput".. how i can make it..?? thank you.. ^^
4 个评论
Jan
2012-4-12
How do you "make some dots in an axes"? Isn't it possible to count the dots during creation already?
采纳的回答
Thomas
2012-4-12
Is this what you want
E.G.
close all
clear variables %changed from clear all on Jan's suggestion
disp('Hit return (enter) to stop entering points');
[x,y]=ginput; % hit return(enter) to stop entering points
plot(x,y,'MarkerFaceColor',[0 0 0],'MarkerEdgeColor',[0 0 0],'Marker','o','LineStyle','none');
num_points=(length(x))
6 个评论
Jan
2012-4-12
@Thomas, I would not have mentioned the problems of "clear all", if this appears less frequently in this forum. It does not cause any problems in your example. But I see it in so many examples, even as first line inside functions -where it is even weird-, that I suggest repeatedly to avoid it. A lot of FEX submissions contain "clear all, close all" and testing them can destroy my current work.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!