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 command window of Matlab not a ‘compiler’ actually. But if you obtain your codes in a Matlab script, you could test your codes inside command window of Matlab. Also you could use the command window in Matlab as a calculator. Matlab actually much more complex calculator. In this text we will show you what is the difference between ending Matlab codes with ‘;’ and without ‘;’. In 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?

Putting ; difference in Matlab

If your Matlab code have ‘;’ at the end of each line like above and shown by red lines, this means that the ans line will not be appear at the command window which will provide much more clean command window. You could see the results at th 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.

Share This Post! Share Tweet Share

Write your comment on this topic.