フィルターのクリア

How can i extract data from given variables, for suppose i want to extract charge and discharge separately.

1 回表示 (過去 30 日間)
Alamdar
Alamdar 2023 年 12 月 6 日
編集済み: Matt J 2023 年 12 月 6 日

回答 (1 件)

Matt J
Matt J 2023 年 12 月 6 日
編集済み: Matt J 2023 年 12 月 6 日
I will assume your data is in a table:
type=["charge";"discharge";"discharge";"charge"];
data=(1:4)';
T=table(type,data)
T = 4×2 table
type data ___________ ____ "charge" 1 "discharge" 2 "discharge" 3 "charge" 4
Tcharge=T(T.type=="charge",:)
Tcharge = 2×2 table
type data ________ ____ "charge" 1 "charge" 4
Tdischarge=T(T.type=="discharge",:)
Tdischarge = 2×2 table
type data ___________ ____ "discharge" 2 "discharge" 3

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by