Extracting data points (with specific coordinates) from plot

3 ビュー (過去 30 日間)
Ali
Ali 2023 年 1 月 23 日
編集済み: Matt J 2023 年 1 月 23 日
Hi,
I have plotted a large number of data. Now from this plot, I want to extract data points that their Y coordinate is either 40 or very close to 40 (say closer than 0.01).
Anyone know how I can do that?

回答 (1 件)

Matt J
Matt J 2023 年 1 月 23 日
編集済み: Matt J 2023 年 1 月 23 日
For example,
Y=40+0.04*linspace(-1,1,10)
Y = 1×10
39.9600 39.9689 39.9778 39.9867 39.9956 40.0044 40.0133 40.0222 40.0311 40.0400
data=10*(1:numel(Y))
data = 1×10
10 20 30 40 50 60 70 80 90 100
data_Extracted = data(abs(Y-40)<=0.01)
data_Extracted = 1×2
50 60

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by