To save Output array in the arranged form

1 回表示 (過去 30 日間)
Syed Muntazir Mehdi
Syed Muntazir Mehdi 2015 年 11 月 27 日
コメント済み: Syed Muntazir Mehdi 2015 年 11 月 27 日
Hello Brothers and sisters!
Actually my problem is that I wish to save the output data from my code in an arranged form, Although I am getting the arranged form of my output data but the problem is that it only appears when I open that output.txt file in Matlab and when i wants to open that text file out of the matlab environment, It just gives me numbers without any order and the shape of matrix no more exists.
The second thing is can we save our data (arrays) directly into an excel sheet? If yes, Please tell me the way
I shall be thankful.

採用された回答

Walter Roberson
Walter Roberson 2015 年 11 月 27 日
For the first question:
You might currently have an fopen() statement that looks something like
fid = fopen('SomeFileName.txt', 'w');
If you do, then change that line to
fid = fopen('SomeFileName.txt', 'wt');
Possibly instead you are using dlmwrite() with something that looks like
dlmwrite('SomeFileName.txt', YourArray);
If you do, then change that line to
dlmwrite('SomeFileName.txt', YourArray, 'Newline', 'pc');
Possibly instead you are using csvwrite() with something that looks like
csvwrite('SomeFileName.txt', YourArray);
If you do then change the csvwrite() to dlmwrite and add the 'Newline', 'pc' option,
dlmwrite('SomeFileName.txt', YourArray, 'Newline', 'pc');
For the second question:
You can use xlswrite() to write directly into .xls or .xlsx format.
  1 件のコメント
Syed Muntazir Mehdi
Syed Muntazir Mehdi 2015 年 11 月 27 日
Thanks alot brother It works now

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by