Home I want to plot line with 3 colors on MATLAB
Reply: 0

I want to plot line with 3 colors on MATLAB

user4679
1#
user4679 Published in September 21, 2018, 2:52 am

I have 3 variables, x, y, z. I want to plot line with 3 colors, red at h=0, green at h=1, blue at h=2.

x = [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14];
y = [0 1 2 1 3 4 7 9 8 6 5 3 2 1 0];
h = [0 0 0 0 0 1 1 1 1 1 2 2 2 2 2];
color = [1 0 0 ; 0 1 0 ; 0 0 1];
share|improve this question
  • 1
    Duplicate of Multiple colors in the same line – Wolfie Dec 7 '17 at 18:14

1 Answer 1

active oldest votes
up vote 0 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.290323 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO