データフレーム型を条件抽出して,時系列データの作り方
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
下のデータフレーム型のデータにおいて,8以下の要素だけ抽出したいのですが,コードの打ち方がわかりません.
教えていただければ幸いです.
0 commentaires
Réponses (1)
COVAO
le 23 Avr 2023
Modifié(e) : COVAO
le 23 Avr 2023
% 6列、10行のTable型データ作成、1から20までの乱数
dataTable = array2table(rand(10, 6)*20)
% 8以下のデータがある要素を抽出
dataArray = table2array(dataTable);
p = find( dataArray <= 8);
newData = dataArray(p)'
% 抽出した要素以外をNaNに置き換え
newVar = NaN(size(dataArray));
newVar(p) = dataArray(p);
newTable = array2table(newVar)
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!