table2arrayで条件に合う変数だけを呼び出す方法
Mostra commenti meno recenti
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なのでループの基本形はこのまま維持したいです。
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su table in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!