Creating figures according to VOI and slicer number

Hello I have data like the following sample: [1 30 1 2; 1 30 3 4; 2 30 5 6; 2 30 7 8; 1 29 9 10; 1 29 11 12] The first col is the VOI number, second col is the slice number, third and fourth are the coordinates. When the slice number change a new figure is generated,regardless of the VOI number. Now I want to see what the VOI represents, so I want to plot the coordinates that corresponds to 2's in the VOI col in the same graph in another color. This is what I have so far.
slice=data(:,2);
row=data(:,3);
col=data(:,4);
voi=data(:,1);
for i=1:length(slice)
if i==1 || slice(i)~=slice(i-1)
figure
hold on
elseif voi(i)==1
plot(row(i),col(i),'r.')
elseif voi(i)==2
plot(row(i),col(i),'y.')
end
end

Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Asked:

on 16 Jul 2013

Community Treasure Hunt

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

Start Hunting!