Borrar filtros
Borrar filtros

how do i bold certain characters in a vector?

4 visualizaciones (últimos 30 días)
Francisco del Bosque
Francisco del Bosque el 19 de Jun. de 2018
Comentada: Stephen23 el 20 de Jun. de 2018
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!

Respuestas (1)

Steven Yeh
Steven Yeh el 19 de Jun. de 2018
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 comentarios
OCDER
OCDER el 19 de Jun. de 2018
Oh, this does work! Nice - didn't realize there was this feature.
Stephen23
Stephen23 el 20 de Jun. de 2018
Note that this feature is NOT documented, so use it at your own risk!

Iniciar sesión para comentar.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by