How to save a matrix into a file repeatedly.

1 回表示 (過去 30 日間)
HanYu Tang
HanYu Tang 2016 年 8 月 21 日
コメント済み: HanYu Tang 2016 年 8 月 22 日
Hi there,
I have made a script for generating a set of features (i.e. a double 30x31 matrix). The script would be run several times depends on the numbers of the file in the folder. After each time of the process, I need to save the matrix into a .mat file. However, I have failed to save all the matrix in one file.
For example, the script is run 10 times, so there are 10 30x31 matrixes. The file should be a 300x31 matrix.
I am wondering if everyone would know how to do it??
Thank you :)

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 21 日
Look at this example
for k=1:10
M=rand(31,30)
out{k,1}=M
end
out=cell2mat(out)
dlmwrite('file.txt',out)
  1 件のコメント
HanYu Tang
HanYu Tang 2016 年 8 月 22 日
Hi Azz
Thank you very much :).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by