Matlab Output Format!

1 次查看(过去 30 天)
dmfwlansejr
dmfwlansejr 2021-3-16
评论: Stephen23 2021-3-16
>> a=1
a =
1
>>
How to convert following format?
>> a=1
a=1
>>
  1 个评论
DGM
DGM 2021-3-16
I don't know that you can get such a format. You can remove the empty lines by specifying
format compact
but trying to get it all on the same line is something else.

请先登录,再进行评论。

回答(1 个)

ANKUR KUMAR
ANKUR KUMAR 2021-3-16
You cannot format the output, but you can use disp to print in that way:
a=1;
disp('a=1')
disp(sprintf('a=%d',a))
You can use either of the last two commands.

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by