データフレーム型を条件抽出して,時系列データの作り方
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
下のデータフレーム型のデータにおいて,8以下の要素だけ抽出したいのですが,コードの打ち方がわかりません.
教えていただければ幸いです.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1342399/image.png)
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
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!