How can I manage a .csv imported file?

1 回表示 (過去 30 日間)
Emiliano Ascenzi
Emiliano Ascenzi 2019 年 12 月 9 日
回答済み: Walter Roberson 2019 年 12 月 9 日
I have imported a .csv table in MATLAB, on this table I have 2 different events, misurated in the same timeline. I'm trying to make MATLAB recognize these different events automatically. From a "visive" point of view is very simple because when the first event ends the value on the plot is 0, but i need MATLAB to do it for me when I'll have more than 2 events. I was thinking about a "for cycle", dunno if is a good idea

採用された回答

Walter Roberson
Walter Roberson 2019 年 12 月 9 日
mask = YourSignal(:).' > 0;
starts = strfind([false mask], [0 1]);
stops = strfind([mask false], [1 0]);
Now starts and stops are vectors such that you have non-zero signal between YourSignal(starts(K):stops(K))
This assumes that none of your signal is negative.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAuthor Block Masks についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by