MATLAB Answers

What should we do when Text exceeds maximum line length for Command Window display in matlab?

27 ビュー (過去 30 日間)
Najmeh Eskandari
Najmeh Eskandari 2018 年 10 月 17 日
編集済み: Najmeh Eskandari 2018 年 11 月 4 日
hi.I want to run the MFILE and (see D matrix) which is attached but there is an error :
Text exceeds maximum line length for Command Window display
when I simplify(D) MATLAB hangs .How can I fix it?

  2 件のコメント

Jan
Jan 2018 年 10 月 17 日
The ZIP file contains 3 M-files: SmallDecimal2Zero.m, ti.m and UR10_Dynamic_parameters.m. Where do I have to "see D matrix"? I recommend, to post the relevant part of the code instead of some files and a vague hint.
Najmeh Eskandari
Najmeh Eskandari 2018 年 10 月 17 日
UR10_dynamic_parameters but the smallDecimal2Zero.m and ti.m functions have been used in the UR10_Dynamic_parameters.m. The codes are short and D is obvious in Ur10....
Thank you

サインインしてコメントする。

採用された回答

madhan ravi
madhan ravi 2018 年 10 月 17 日
save the D matrix as a text file using:
dlmwrite('D_matrix.txt',D) %assuming matrix D is contains doubles

  2 件のコメント

Najmeh Eskandari
Najmeh Eskandari 2018 年 10 月 17 日
yes but in this case we should use forexample :
fwrite(fid, char(T06), 'char');

サインインしてコメントする。

その他の回答 (1 件)

Steven Lord
Steven Lord 2018 年 10 月 17 日
From the messages you've posted, D is an extremely long symbolic expression. While you might be able to read it, I'm skeptical that you'll find it useful or informative. A quick Google search says that a rule of thumb is that one 8.5" by 11" page of text is about 3000 characters, meaning that if you printed your symbolic expression it would span at least 8 pages or so (if I remember the threshold for the "Text exceeds maximum line length for Command Window display" message correctly.)
Now if your symbolic expression is that long, it's likely to be at least somewhat complicated. I'm not sure if your simplify command hung or if it is just taking a very long time to try to simplify that complicated expression.
Some suggestions for ways to do some simplification of D: use subs to substitute in numeric values for some or all of the symbolic variables, use vpa to approximate the symbolic form of a numeric expression as a number with perhaps fewer digits, extract common subexpressions using subexpr, convert it to a char and write that char to a file on disk as madhan ravi suggested, or maybe convert it into a MATLAB function file using matlabFunction with optimization enabled.

  0 件のコメント

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by