Hi,
I want to display something like this:
1 2 3 1
x'(t) = 4 5 6 * x(t) + 2 * u(t)
7 8 9 3
y(t) = [0 0 1] * x'(t)
The matrix and the vector are variable. Is it possible to display it with the disp()-function?
In additon it would be very nice if there is an opportunity to make an underline and a dot over a letter.
Thanks :)

답변 (1개)

Walter Roberson
Walter Roberson 2015년 7월 27일

0 개 추천

You have to build the whole thing up using string manipulation. You would probably find that easiest to do using sprintf(). For the matrix part you might find it easiest to use num2str() as that automatically handles adjusting the spacing to get nice aligned columns.

댓글 수: 2

Marc Kemper
Marc Kemper 2015년 7월 27일
thanks!!
do you know something about the underline and the dot ?
Walter Roberson
Walter Roberson 2015년 7월 27일
Put them on the line above or the line below.
If you use those then when you create your strings, remember to take into account that these will not add visual width but will take up length().

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

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

질문:

2015년 7월 27일

댓글:

2015년 7월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by