I know this might seem trivial, but I want to know how I can change how my matrices display, without functions. Is there a preference I need to change or something? I see other people have their matrices justified/aligned in the command window, but I can't seem to know why I don't. When working with lengthy matrices and symbolic variables this can become a hassle.
I show an example here of my output when working with Jacobian matrices.
Capture.PNG

댓글 수: 4

Walter Roberson
Walter Roberson 2019년 5월 3일
pretty(J11)
RobertoRdz
RobertoRdz 2019년 5월 4일
Doesn´t really help, and I am almost sure this has to be a preference within Matlab but I have turned all the knobs in the program and nothing.
Walter Roberson
Walter Roberson 2019년 5월 4일
There is no preference in MATLAB that is related to this.
The ragged display could happen if you had a variable-width font for the command window.
RobertoRdz
RobertoRdz 2019년 5월 4일
Thanks! This really helped! I changed the font to Consolas and it fixed it!

댓글을 달려면 로그인하십시오.

답변 (1개)

Paul Hoffrichter
Paul Hoffrichter 2021년 4월 25일

0 개 추천

I find this form using Live Editor preferable to pretty.
syms t1 t2 t3 d3 a2
J11 = [-cos(t1)*(d3*cos(t2+t3) + a2*cos(t2)), sin(t1)*(d3*sin(t2+t3) +a2*sin(t2)), d3*sin(t2+t3)*sin(t1);
-sin(t1)*(d3*cos(t2+t3) + a2*cos(t2)), -cos(t1)*(d3*sin(t2+t3) + a2*sin(t2)), -d3*sin(t2+t3)*cos(t1);
0, d3*cos(t2+t3) + a2*cos(t2), d3*cos(t2+t3)]

댓글 수: 1

Walter Roberson
Walter Roberson 2021년 4월 25일
It is certainly a nicer looking display.
Unfortunately the output is not something we can copy and paste into code (though pretty() is not suitable for code either.)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Argument Definitions에 대해 자세히 알아보기

질문:

2019년 5월 3일

댓글:

2021년 4월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by