%% Result of a Simple Calculation
% Perform a simple calculation in the Command Window without assigning the result to a variable. MATLAB stores the result in the ans variable.
%

2 + 2

%
% Perform a simple calculation in the Command Window and assign the result to the variable result.

result = 4 + 4

% Display the values of result and then ans. MATLAB displays the value of result without returning an output. Therefore, the value of ans remains unchanged.

result
ans