x = -pi:0.1:pi;
5 + 5
3 ^ 2 % 3 raised to the power of 2
sin(pi /2) % sine of angle 90o
7/0  % Divide by zero
732 * 20.3
x = 3;
y = x + 5
x = 9 % assign the value 9 to x
save myfile
x = 3 % defining x and initializing it with a value
x = sqrt(16) % defining x and initializing it with an expression
sqrt(78)
9876/ans
x = 7 * 8;
y = x * 7.89
a = 2; b = 7; c = a * b;
who
clear x % it will delete x, won't display anything
clear % it will delete all variables in the workspace
% peacefully and unobtrusively
initial_velocity = 0;
acceleration = 9.8;
format long
x = 7 + 10/3 + 5 ^ 1.2
format short
x = 7 + 10/3 + 5 ^ 1.2
4.678 * 4.9
r = [7 8 9 10 11];
t = [2, 3, 4, 5, 6];
res = r + t
c = [7; 8; 9; 10; 11]
m = [1 2 3; 4 5 6; 7 8 9]
edit
Or
edit <filename>
NoOfStudents = 6000;
TeachingStaff = 150;
NonTeachingStaff = 20;
Total = NoOfStudents + TeachingStaff ...
+ NonTeachingStaff;
a = 5; b = 7;
c = a + b
d = c + sin(b)
e = 5 * d
f = exp(-d)
Total = 42
str = 'Hello World!'
n = 2345
d = double(n)
un = uint32(789.50)
rn = 5678.92347
c = int32(rn)
x = 3
isinteger(x)
isfloat(x)
isvector(x)
isscalar(x)
isnumeric(x)
x = 23.54
isinteger(x)
isfloat(x)
isvector(x)
isscalar(x)
isnumeric(x)
x = [1 2 3]
isinteger(x)
isfloat(x)
isvector(x)
isscalar(x)
x = 'Hello'
isinteger(x)
isfloat(x)
isvector(x)
isscalar(x)
isnumeric(x)
a = 10;
b = 20;
c = a + b
d = a - b
e = a * b
f = a / b
g = a \ b
x = 7;
y = 3;
z = x ^ y

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: