table2arrayで条件に合う変数だけを呼び出す方法
Afficher commentaires plus anciens
csvfile<-readtable('csvfile.csv')
for n=1:3
VarX=table2array(csvfile((csvfile.name == name{n}), ★★));
end
添付した16行×3列のcsvファイルを読み込み(変数はname, id, profit)、各nameの値(5つの観測値)ごとにid==1(実際はidは1,2,3,4,5まである)を満たすprofitのみを取り出して別のtableにしたいのですが、↑の★★の部分にどのようなコードを書けばよいでしょうか。実際にやりたいものはn=25なのでループの基本形はこのまま維持したいです。
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur table dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!