The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

Advanced Search

Back to Topic List Back to Topic List  

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

c = 'g*'; % values greater than 3 and less than 2

hold on

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.