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 次查看(过去 30 天)
显示 更早的评论
a=3; b=4; c=6; d=7; e=9;
0 个评论
采纳的回答
Image Analyst
2016-9-1
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
更多回答(1 个)
Azzi Abdelmalek
2016-9-1
编辑:Azzi Abdelmalek
2016-9-1
str={'a','b','c','d'}
v={3 4 5 6}
w=[str; v]
sprintf('%s=%d;',w{:})
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!