Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Plot certain values in cell array in color
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Jannet

Posts: 4
Registered: 10/11/12
Plot certain values in cell array in color
Posted: Dec 6, 2012 3:17 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi Guys

This is driving me crazy. I am trying to plot values between 2 and 3 on the y axis for cell array in red.It is plotting everything green and I am stuck. So this is partially working. Any help appreciated.

numsteps = 200;

x1 = 2:1:numsteps;
x2 = 2:1:numsteps;
y1 = 2:1:numsteps;
y2 = 2:1:numsteps;
for ii = 2:1:(numsteps) %Looping
y1(ii) = d(x1(ii)); % Data point ii has come in.
y2(ii) = d(x2(ii) );
if M2{1,1}(ii)<=2 & M2{1,2}(ii)>=3 || M3{1,1}(ii)<=2 & M3{1,2}(ii)>=3
c = 'r*'; % Color for values between 2 and 3 y axis

else
c = 'g*'; % values greater than 3 and less than 2
end
plot(M2{1,1}(ii),M2{1,2}(ii),c,M3{1,1}(ii),M3{1,2}(ii),c))

hold on
end



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.