clc
clear all
close all

X1 = [1 2 3 4 5]
X2 = [1,2,3,4,5]

Y1 = [6;7;8;9;10]
Y2 = [6 7 8 9 10]'
Y3 = transpose(X1)
Y4 = X1'
X3 = Y1'

pause
% =====================================================================
clc
U1 = [0:10]
U2 = 0:10

V1 = [0:.2:10]
V2 = 0:.2:10

W = [10:-1:-10]

pause
% =====================================================================
clc

S = linspace(0,2*pi)
T = linspace(0,2*pi,1000)

pause
% =====================================================================
clc

maxY1 = max(Y1)
minT = min(T)
lengthT = length(T)
sortW = sort(W)
sumX1 = sum(X1)
prodY1 = prod(Y1)
medianS = median(S)
meanY1 = mean(Y1)
stdS = std(S)
sizeT = size(T)

pause
% =====================================================================
clc
X = [1 5 2 4]
Y = [3 2 2 6]

threeX = 3*X
XX = X.*X
YY = Y.^2
XY = X+Y
cosX = cos(X)
expX = exp(Y)
logX = log(X)

pause
% =====================================================================
clc

zeros1 = zeros(1,5)
ones1 = ones(1,7)
rand1 = rand(1,10)
nan1 = nan(1,5)

pause
% =====================================================================
clc

M = [7 3 2 9 1]

M13 = M(1:3)
M35 = M(3:5)
N = M(1:3)
P = [M(1) M(3) M(4)]
MP = M(1:3) + P
MM = M(1) + M(4)
% M(7) does not exist so create it
M(7) = 7

V = 1:1000;
newV = V(20:4:850)

pause
% =====================================================================
clc

A1 = ['J' 'a' 'n' 'e' ' ' 'S' 'a' 'y' 's']
A2 = 'Jane Says'

B1 = ['I' '''m' ' ' 'd' 'o' 'n' 'e' ' ' 'w' 'i' 't' 'h' ' ' 'S' 'e' 'r' 'g' 'i' 'o']
B2 = 'I''m done with Sergio'

A1(1:4) = 'Dave'

pause
% =====================================================================
clc

start = input('Enter the first value of your vector:');
stop = input('Enter the last value of your vector:');
dx = input('Enter the jump value:');

vector = start:dx:stop

lengthOnes = input('Enter the length of the ones vector:');
onesVector = ones(1,lengthOnes)

lengthZeros = input('Enter the length of the zeros vector:');
zerosVector = zeros(1,lengthZeros)

lengthRand = input('Enter the length of the rand vector:');
randVector = rand(1,lengthRand)

lengthNan = input('Enter the length of the NaN vector:');
nanVector = nan(1,lengthNan)

display('Now you can change the length of your rand vector.');
addRand = input('How many more values would you like to add?');
newLength = lengthRand + addRand;
randVector(newLength) = rand

display('Until we learn to use loops and if statements, we will have the extra zeros in our vector.');
fprintf('Now we will create a new rand vector with length %d',newLength);
newRandVector = rand(1,newLength)