フィルターのクリア

How can I save each column of a matrix as separate .dat file?

4 ビュー (過去 30 日間)
Titli
Titli 2017 年 8 月 1 日
コメント済み: KSSV 2017 年 8 月 1 日
I have a matrix of 40 columns. I want to save separate .dat files for each column. Can anyone help me with it?
Thanks in advance.
  2 件のコメント
Stephen23
Stephen23 2017 年 8 月 1 日
編集済み: Stephen23 2017 年 8 月 1 日
José-Luis
José-Luis 2017 年 8 月 1 日
Why do you want to do that? It is probably a bad idea. What are you trying to achieve?

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

採用された回答

KSSV
KSSV 2017 年 8 月 1 日
編集済み: KSSV 2017 年 8 月 1 日
A = rand(10,40) ;
for i = 1:size(A,2)
filename = strcat('column',num2str(i),'.txt') ;
c = A(:,i) ;
save(filename,'c','-ascii')
end
  1 件のコメント
KSSV
KSSV 2017 年 8 月 1 日
Titli Saha comment moved here:
Thank you so much :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by