Equation in the exported text file is truncated
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
VBBV
el 22 de Jul. de 2023
Editada: VBBV
el 22 de Jul. de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre String Parsing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!