How to plot points of same color based on values
1 次查看(过去 30 天)
显示 更早的评论
a = ginput(33);
a1 = input('initial value of a1: ');
a17 = input('initial value of blank or a17: ');
noth = input('value of the fields that are not counted: ');
a2 = a1; a3 = a1;
a4 = a1; a5 = a1; a6 = a1;
a7 = a1; a8 = a1; a9 = a1; a10 = a1; a11 = a1; a12 = a1; a13 = a1;
a14 = a1; a15 = a1; a16 = a1; a18 = a1; a19 = a1; a20 = a1;
a21 = a1; a22 = a1; a23 = a1; a24 = a1;a25 = a1; a26 = a1; a27 = a1;
a28 = a1; a29 = a1; a30 = a1;
a31 = a1; a32 = a1; a33 = a1;
%%design for game of hi Q
c = [noth,noth,a1,a2,a3,noth,noth;noth,noth,a4,a5,a6,noth,noth;a7,a8,a9,a10,a11,a12,a13;a14,a15,a16,a17,a18,a19,a20;a21,a22,a23,a24,a25,a26,a27;noth,noth,a28,a29,a30,noth,noth;noth,noth,a31,a32,a33,noth,noth];
now i wish to go like this
for i = 1:49
if c(i) == 1
then blue points would be plotted
if c(i)== 0
then red points would be plotted
and if c(i) == 2
then nothing will be plotted, it will be blank
how can i do this? please no rude comment. your help is appreciated.
2 个评论
Image Analyst
2014-4-24
What do you want to plot? c? The a's? Why do you have all those separate a's instead of an array?
回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!