cell配列のをcsvで保存する方法
Show older comments
cell配列のをcsvで保存する方法について質問です。
以下のcell 配列があります。
%cell配列を作る
for i = 1:3
TEST{1,i} = strcat('test',num2str(i));
end
for i = 1:3
TEST{2,i} = strcat('set',num2str(i));
end
A = [1:100];
B = A*10;
C = A*0.1;
TEST{3,1} = A;
TEST{3,2} = B;
TEST{3,1} = C;
%下の様なcell配列になります
% 'test1' 'test2' 'test3'
% 'set1' 'set2' 'set3'
% 1×100 do.. 1×100 do.. 1×100 do..
この変数[TEST]をcsvで保存したいのですがどのような方法がありますか?
csvwrite('csvlist.csv',cell2mat(TEST(3,1)))
上のだと[1:100]の配列しか書き込めないので思うようにいきません。
csvの結果は下のようにしたいです。
test1,test2,test3
set1,set2,set3
1,10,0.1
2,20,0.2
3,30,0.3 …
宜しくお願いします。
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!