MATLAB: Plotting time series within a limit and without certain data points

plottingtime series

Hi
I have attached the timeseries data ("long_pos.mat") which I plotted to get to get the following figure.
I want to get the plot within ylim [0 600] and without the vertical lines(which are generated due to -150 values in the timeseries data). Can someone kindly help me with this? Thank you.

Best Answer

Here is the solution
load long_pos.mat
Y = simout_x.Data; % extract data
T = simout_x.Time; % extract time
Y(Y<0) = nan; % replace negative values with 'NaN'
plot(T,Y);