Equation in the exported text file is truncated

4 ビュー (過去 30 日間)
Siavash 2023 年 7 月 22 日
編集済み: VBBV 2023 年 7 月 22 日
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 );


VBBV 2023 年 7 月 22 日
編集済み: VBBV 2023 年 7 月 22 日
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
  1 件のコメント
Siavash 2023 年 7 月 22 日
oh! wow! Thanks!!


その他の回答 (0 件)


Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by