Equation in the exported text file is truncated
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I solve some equations in symbolic toolbox. As Matlab only prints a limited number of characters, I write these equations in text files.
However, it seems that most of my text files are also truncated.
For example, when I copy and paste the solution Matlab tells me there is a problem with the parantheses that were opened.
First, I thought there is a limit on the file size, but then I realized two different solutions are truncated and one is 1,348 KB and the other one 992 KB. So it mustn't be due to a file size limit.
Thank you for your help.
Here is how I write the variable in the file:
fileID = fopen('MATLAB_MSOL.txt', 'w');
Solution = char(M_sol(1));
fprintf(fileID, '%s\n','mu33_1 = ', Solution);
fclose(fileID );
0 commentaires
Réponse acceptée
VBBV
le 22 Juil 2023
Modifié(e) : VBBV
le 22 Juil 2023
fprintf(fileID, '%50s\t %50s\n','mu33_1 = ', Solution);
Since you want to print *mu33_1* and *Solution* as characters to the file , you will need n additional format specifier. You need to use as many format specifiers as the number of characters to print in the file to avoid truncation
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur String Parsing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!