I am trying to bold an i,j, and k for vector equations. How can I do this using fprintf?
p=[-1,7,-3]; v=[5,12,-7];
syms t
vec=p+t*v
fprintf('The vector equation for the line is %si+%sj+%sk\n and the parametric equations are x= %s,\ny= %s, z=%s',vec,vec)
thanks!

답변 (1개)

Steven Yeh
Steven Yeh 2018년 6월 19일

2 개 추천

You can try Element Style tag:
fprintf(['The vector equation for the line is %s', ...
['<strong>i</strong>'], ...
'+%s', ...
['<strong>j</strong>'], ...
'+%s', ...
['<strong>k</strong>'], ...
'\n and the parametric equations are x= %s,\ny= %s, z=%s\n'],vec,vec)
This can bolden the three characters: i, j, k

댓글 수: 2

OCDER
OCDER 2018년 6월 19일
Oh, this does work! Nice - didn't realize there was this feature.
Stephen23
Stephen23 2018년 6월 20일
Note that this feature is NOT documented, so use it at your own risk!

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

카테고리

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

제품

릴리스

R2018a

질문:

2018년 6월 19일

댓글:

2018년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by