Hi,
I have the following code but it is not doing what I want it to do yet. I was wondering if you could help me fix it.
Instead of only plotting the data points for C it is doing for all the outputs of C, D and E.
What I am trying to do for C, I am also truying for D and E.
A = [5 5.3 0.02; 10 1.0 1.11; 10 0.4 0.85; 3 0.3 0.34];B = [3 2.1 0.82; 10 5.3 1.00; 5 5.3 0.02; 5 0.2 1.57; 10 1.0 1.11; 10 0.4 0.85];%% First set of conditions
C = setdiff(B,A,'rows','stable') %Rows only in B
D = setdiff(B,C,'rows','stable') %Rows in A and B
E = setdiff(A,[C;D],'rows','stable') %Rows only in A
%% Second set of conditions
% for C
already_plotted = false(size(C));L= C(:,1) == 5;plot(A(L),B(L),'rp')already_plotted(L)=true;L= C(:,1) == 10 & ~already_plotted;hold onplot(A(L),B(L),'ro')already_plotted(L)=true;L= C(:,1) == 3 & ~already_plotted;hold onplot(A(L),B(L),'rs')
Best Answer