All ProgramsCAEMatLabMatLab Programming

The Difference Ending Codes With ‘;’ And Without ‘;’ in Matlab®(ILLUSTRATED)

The command window in Matlab® works in a very different way compared with other software language compiler. Also, the command window of Matlab® not a ‘compiler’ actually. But if you obtain your codes in a Matlab script, you could test your codes inside the command window of Matlab.

Also, you could use the command window in Matlab® as a calculator. Matlab® actually a much more complex calculator. In this text we will show you what is the difference between ending Matlab® codes with ‘;’ and without ‘;’. In the command line, there is a difference in this context.

YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!

What Is The Duty Of ‘;’ In Matlab® Codes?

>> a = 3;
b = 4;
c = a+b

c =



If your Matlab® code has ‘;’ at the end of each line like above, this means that the ans line will not appear at the command window which will provide a much more clean command window. You could see the results at the Workspace.

But if you don’t put ‘;’ to the end of your Matlab® codes like above shown by red arrows, the results will appear at the command window like above. This is very useful for using Matlab® as a calculator. You could see the results of mathematical calculations in Matlab®.


Do not forget to leave your comments and questions below about the use of ‘;’ in Matlab® below. 

If you want further coding examples about ‘;’ in Matlab®, inform us in the comments.

This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®

Your precious feedbacks are very important to us.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button