hello, i have 5 input as following , how to use print command as print(' a= ' a , ' b= ' b, ' c= ' c, ' d= ' d,' e= ' e) in order to display output a=3 b =4 c=6 d=7 e=9

2 visualizaciones (últimos 30 días)
a=3; b=4; c=6; d=7; e=9;

Respuesta aceptada

Image Analyst
Image Analyst el 1 de Sept. de 2016
Try this:
a=3;
b=4;
c=6;
d=7;
e=9;
% Display output a=3 b =4 c=6 d=7 e=9
fprintf('a=%d b =%d c=%d d=%d e=%d\n', a,b,c,d,e);
Results in the command window match your desired result.
a=3 b =4 c=6 d=7 e=9
  2 comentarios
mohammed hamdy
mohammed hamdy el 1 de Sept. de 2016
Editada: mohammed hamdy el 1 de Sept. de 2016
thank u very much . true answer..but i used fprintf('segma=%d z0 =%d phi=%d\n', s(tt),z0(tt),phi(tt)); display segma=2 z0 =3.000000e-01 phi=4.000000e-01 in terms of e . what i do to display output without e
mohammed hamdy
mohammed hamdy el 1 de Sept. de 2016
thank u very much . true answer..but i used fprintf('segma=%d z0 =%d phi=%d\n', s(tt),z0(tt),phi(tt)); display segma=2 z0 =3.000000e-01 phi=4.000000e-01 in terms of e . what i do to display output without e

Iniciar sesión para comentar.

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 1 de Sept. de 2016
Editada: Azzi Abdelmalek el 1 de Sept. de 2016
str={'a','b','c','d'}
v={3 4 5 6}
w=[str; v]
sprintf('%s=%d;',w{:})

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by