Hi Michail,
You can define a colormap using hsv function and then choose a line color according to the values of data(:,2). You can have a look at the following ML Answers post which describes an approach to achieve this: https://www.mathworks.com/matlabcentral/answers/91170-define-colormap-according-to-certain-variable
Hope this helps.