Displaying Variables In MatLab® With ‘disp()’ Code(Illustrated Expression)

The addition of displaying commands in codes could be very vital for the user of this code in Matlab®. Matlab® provides various kinds of displaying options to users and coders. One of them is the disp() command. It is a very basic and useful displaying command in Matlab®. In this article, we will show you how to use the ‘disp()’ command to display various kinds of variables or characters in Matlab®.

How To Use ‘disp()’ Command In Matlab®?

>> a = 775;
disp(a); disp('meters');
   775

meters
>> 

So it is very basic to use the disp() command as above. If you want to display a variable, matrix, or vector in the Command Window, you just type the variable inside the parenthesis of the disp() command in Matlab® as shown above.

If you want to display characters, you need to type the characters inside quotation marks in the parenthesis of the disp() command in Matlab® as shown above.

Conclusion

So it is very basic to use the disp() command in Matlab® to display various variables and strings.

Leave your comments and questions below!

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

Comments

Leave a Reply

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