To save Output array in the arranged form
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Syed Muntazir Mehdi
am 27 Nov. 2015
Kommentiert: Syed Muntazir Mehdi
am 27 Nov. 2015
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.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 27 Nov. 2015
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!