Plotting time series within a limit and without certain data points
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 12 Apr. 2020
Try this:
s = load('long_pos.mat')
simout_x = s.simout_x;
tsInfo = get(simout_x)
data = simout_x.Data;
% Replace -150 with nan so it won't plot.
data(data == -150) = nan;
t = simout_x.Time
for col = 1 : size(data, 2)
plot(t, data(:, col), '-', 'LineWidth', 2);
hold on;
end
xlabel('t', 'FontSize', 15);
ylabel('y', 'FontSize', 15);
ylim([0, 600]);
grid on

1 Kommentar
Mudasser Seraj
am 12 Apr. 2020
Kategorien
Mehr zu Annotations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!