To save Output array in the arranged form
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Syed Muntazir Mehdi
il 27 Nov 2015
Commentato: Syed Muntazir Mehdi
il 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 Commenti
Risposta accettata
Walter Roberson
il 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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!