CSV file read and disassemble information
3 ビュー (過去 30 日間)
古いコメントを表示
I have this csv file with a person's fitness information and a want read it in matlab. I need to disassemble all variables from one cell to 28 cells (number of all variables). how can i do it?
0 件のコメント
回答 (1 件)
Ahmet Cecen
2015 年 5 月 3 日
You cannot use dlmread or csvread for mixed format files. To my best knowledge your best chance is a table:
T = readtable('file1.csv','Delimiter',',','ReadVariableNames',false);
C=table2cell(T);
A=cell(1,33);
B=cell(1,33);
c=0;
for i=1:66
if mod(i,2)==1
c=c+1;A{c}=C{i};
else
e=e+1;B{c}=C{i};
end
end
T = cell2table(B(6:33),'VariableNames',A(6:33));
I am assuming the first 5 values are unimportant, since you said 28 variables.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Workspace Variables and MAT Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!