A01.m - Hello World: The Fancy Version

% the following 3 commands are useful housekeeping tools to help tidy-up
% your workspace
clc         % clear command window
clear       % clear all variables
close all   % close all graphics windows

% prints a message to the command window using the disp (display) command
disp('hello world')

% adds 1 + 1 and stores the result (2) in the variable x. Because the
% statement has a semi-colon at the end, the result is not printed to the
% command window
x = 1+1;

% this calculation has no semicolon, so the result 6 is printed to the
% command window
y = x + 4

Download A01.m

We modify the basic Hello World program in a few ways:

Monkey Home   |    Prev   |   Next