Print a statement to the Command Window
10,318 次查看(过去 30 天)
显示 更早的评论
I am writing a program. I want to display the statement 'job done' as the output in the Command Window. How can I do it?
2 个评论
GOPINATHAN PRAKASH
2021-6-20
Hai navneet nayan,
disp('job done');
disp command is used display the string values.
采纳的回答
KSSV
2017-5-5
编辑:MathWorks Support Team
2020-2-27
2 个评论
Jared MacDonald
2023-5-17,20:23
Hi John,
There is no way to direct output to the Command Window from a live script that you run in the Live Editor.
You can run the live script from the command line; e.g., if your file is myScript.mlx, then
>> myScript
will indeed output to the Command Window (and separate figure windows). But again there's no way to redirect output from the Live Editor. This is something we are investigating, however.
Jared
更多回答(5 个)
Gaurav Srivastava
2019-5-26
It's not happening. How to display LHS=RHS?.png)
.png)
3 个评论
sidway
2021-8-13
Try to make a diference between a and b with a tolerance
tol = 1e-3
if abs(a - b) < tol
disp('LHS=RHS')
end
Dhritishman
2022-7-10
Use the disp function to print to the command window:
disp('job done')
3 个评论
Jared MacDonald
2023-5-17,20:24
Hi Jack,
There is no way to direct output to the Command Window from a live script that you run in the Live Editor.
You can run the live script from the command line; e.g., if your file is myScript.mlx, then
>> myScript
will indeed output to the Command Window (and separate figure windows). But again there's no way to redirect output from the Live Editor. This is something we are investigating, however.
Jared
另请参阅
类别
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!