display a variable in matlab

To display a variable in Matlab, you can simply type the name of the variable in the command window and press Enter. For example, if you have a variable x, you can display its value by typing x in the command window and pressing Enter:

main.m
>> x = 10
x =
    10

>> x
x =
    10
38 chars
8 lines

Alternatively, you can also use the disp function to display the variable:

main.m
>> x = 10
>> disp(x)
    10
28 chars
4 lines

This will display the value of the variable x in the command window.

gistlibby LogSnag