how to stop the working of format longg after some line execute in matlab

4 次查看(过去 30 天)
format longg
t=clock;
T1=(t([5,6]))
CT=text(X6,Y6,num2str(N3),'FontWeight','bold','fontsize',12,'color','r'),pause(.4)
now i wish to format longg is used before CT execute or terminate the working of long before CT execute. because it will be long the value of CT like
CT=604.002563476563

回答(1 个)

Jan
Jan 2015-6-13
The format command has effects only for the display in the command window. It does not concern the values inside the code. In your example format does not influence the value of T1, only the display in the command window.
The value displayed for CT is the handle of the text object. The format command is not useful here, but set a semicolon at the end of the command to suppress the output to the command window:
CT = text(X6,Y6,num2str(N3),'FontWeight','bold','fontsize',12,'color','r');

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by