I want to separate each gait cycle and keep each cycle in a row of a table.

22 ビュー (過去 30 日間)
Mohammad Ahmad
Mohammad Ahmad 2021 年 12 月 8 日
コメント済み: Mohammad Ahmad 2021 年 12 月 12 日
I have an excel file (attached here) having a column of data that has data points of several consecutive vertical GRF cycles. I want to separate each gait cycle and keep each cycle in a row of a table.How I can do it using MATLAB?
Thanks in advance.

採用された回答

Eric Sofen
Eric Sofen 2021 年 12 月 8 日
If you separate each cycle into a separat row, the rows will likely have data of different lengths, which then gets hard to work with because you'll need to store them in cell arrays. As a starting point, here's what I'd do:
t = readtable("h1l_130710_1_110.xlsx");
t.Min = islocalmin(t.Fz,"MinProminence",500); % this works pretty well.
% % I recommend using the "Find Local Extrema" live task to play around with peak-finding parameters interactively.
t.Cycle = cumsum(t.Min);
t.Min = [] % probably don't need this any more
% now you have Cycle as a grouping variable and you can use things like
% groupsummary or varfun to do calculations on each gait cycle.
%If you really want the data as rows...
t = varfun(@(x) {x'}, t, "GroupingVariables","Cycle")
  4 件のコメント
Mohammad Ahmad
Mohammad Ahmad 2021 年 12 月 10 日
thank you for your response. Here the variable Fun_Fz is unrecognized. could you please address it? I tried several times but could'nt find any way.
Mohammad Ahmad
Mohammad Ahmad 2021 年 12 月 12 日
please address this issue

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by