Remove all infinite values from ydata and then remove those same indices from the xdata so the vectors remain the same length
4 ビュー (過去 30 日間)
古いコメントを表示
Any recommendations to remove all infinite values from ydata and then remove those same indices from the xdata so the vectors remain the same length? I have removed the infinite values from the ydata and then outputed the indices that are finite, but I am unsure how to easily extract these same indices from the xdata. Thank you
0 件のコメント
回答 (1 件)
James Tursa
2020 年 1 月 7 日
編集済み: James Tursa
2020 年 1 月 7 日
x = isinf(ydata);
ydata(x) = [];
xdata(x) = [];
Or, if you need to extract the values into new variables,
x = ~isinf(ydata);
ydata_new = ydata(x);
xdata_new = xdata(x);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!