
clear %Clears the workspace
clc %clears command window

%Vector or matrixes
% Upright vector
vec = [1;2;3];
vec2 = [4, 5, 6];

% Indexes start at 1 in matlab
num1 = vec2(2);
%disp(num1)

mtx = [1,2 ; 3,4];
Ax = mtx * mtx;
Bx = mtx .* mtx;

% * gives matrix multiplication
% .* dotwise/elementwise multiplication
% same goes if repeated multiplication using ^ or .^

%create vector
x = 1:0.5:10;

%create function
fun = @(x) x.^2;
disp(fun(3));

y = fun(x);

plot(x,y)