Print a statement to the Command Window

8,205 views (last 30 days)
NAVNEET NAYAN
NAVNEET NAYAN on 5 May 2017
Answered: Dhritishmanon 10 Jul 2022
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 Comments
GOPINATHAN PRAKASH
GOPINATHAN PRAKASH on 20 Jun 2021
Hai navneet nayan,
disp('job done');
disp command is used display the string values.

Sign in to comment.

Accepted Answer

KSSV
KSSV on 5 May 2017
Edited:MathWorks Support Team on 27 Feb 2020
To display text in the Command Window, use disp or fprintf .
disp('job done')
or
fprintf('job done \n')

More Answers (5)

Gaurav Srivastava
Gaurav Srivastava on 26 May 2019
It's not happening. How to display LHS=RHS? Screenshot (9).png
3 Comments
sidway
sidway on 13 Aug 2021
Try to make a diference between a and b with a tolerance
托尔= 1 e - 3
ifabs(a - b) < tol
disp('LHS=RHS')
end

Sign in to comment.


Peyton Spainhour
Peyton Spainhour 2020年10月29日
A=6
for k =1:5
if A<=15
A=A + 3
else
A = A+2
end
end
A

Haya Bragg
Haya Bragg on 29 Nov 2021
print data

Haya Bragg
Haya Bragg on 29 Nov 2021
how to print data file

Dhritishman
Dhritishman on 10 Jul 2022
Use the disp function to print to the command window:
disp('job done')
job done

Community Treasure Hunt

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

Start Hunting!