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: changing color plot in a looped figure plotting
Replies: 1   Last Post: Nov 24, 2012 9:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Gael crevoise

Posts: 3
Registered: 11/23/12
changing color plot in a looped figure plotting
Posted: Nov 23, 2012 5:52 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,

I have a question about plotting while looping to get information from an excel file

I have the following script:
for i=3:6:225
x=xlsread('test.xlsx','Sheet1',['B' int2str(i) ':JB' int2str(i)]);
y=xlsread('test.xlsx','Sheet1',['B' int2str(i+1) ':JB' int2str(i+1)]');
plot(x,y)
hold on
end
hold off

I wish to have different color for different part of the plot. For example, it could be great that all data from 3,21,39....are plotted in green, while the one 9,27,45.... are in blue, and the data 15,33,51....are plotted in red.

Is it possible to make such a things?
Thanks a lot for your help



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.