Using find function in Matlab to find data at specific time

10 ビュー (過去 30 日間)
gps
gps 2021 年 3 月 27 日
コメント済み: Jan 2021 年 6 月 7 日
How can I use the find function in MATLAB in order to create a variable that includes data starting at time, t=0?
I have tried this:
N = find(Data(:)==0);
but I just get N equal to the number of data that are at t=0, not the actual data themselves.
  1 件のコメント
dpb
dpb 2021 年 3 月 27 日
Don't need find at all here...
zData=Data(Data==0);
"Logical Addressing"

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2021 年 3 月 27 日
index = find(Data >= 0, 1, 'first');
N = Data(index:end)
  2 件のコメント
gps
gps 2021 年 6 月 7 日
編集済み: gps 2021 年 6 月 7 日
@Jan thank you for the help! i have a follow up question, is there a way of editing this for the case where my data have two columns, say x and t, rather than one and I just want my variable to contain only the data from column, starting from t=0 and onwards?
Jan
Jan 2021 年 6 月 7 日
index = find(Data(:, 2) >= 0, 1, 'first');
N = Data(index:end, :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by