table2arrayで条件に合う変数だけを呼び出す方法
Mostrar comentarios más antiguos
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なのでループの基本形はこのまま維持したいです。
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre table en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!