Remove nonsensical data in plot (for loop )
3 次查看(过去 30 天)
显示 更早的评论
I am plotting my results from thermodynamic cycle analysis using a for loop. However, some curves have non-sensical data and I would like to remove them. The X-data is fixed, but the loction of where the Y-data become non-sensical varies. Is there a solution to this particular issue?
4 个评论
dpb
2025-10-4
How are the results being generated; why not fix that proceess to not create the discontinuities to begin with?
If nothing else, at least attach .mat files containing the data such that somebody can do something with it; nothing can be done with the images except look at them.
回答(1 个)
Walter Roberson
2025-10-5
%assume that Data_To_plot is an N x 7 array of data to be plotted
Copy_Data = Data_To_plot;
Copy_Data(~cumprod(Data_To_Plot > 0, 1)) = nan;
plot(x, Copy_Data)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!