I was able to get help that lead to a solution.
For completeness, i'm posting it here.
loop = 1;
while loop == 1
% Task 4
% what is the objective of this for loop
% for multiple forces, each element of the array is it's own point
% for for F = [800, 350, 200] a = [3, 5, 8]; 800 is the F, 3 is the a
% the output of this array will be concatenated with the next round which
% will be F = 350, a = 5
% lastly F = 200, a = 8
% this will yield 3 rows
% two for loops will be needed
Fmultiple = input('Enter multiple concentrated forces [N] in array format: ');
amultiple = input(sprintf('Enter multiple locations (0 - %0.0f) [m]: ', L));
z = length(amultiple); % this is the length of the amultiple user vector input
% a new blank vector must be created to which outputs in the loops will be
% appended
%c = 0;
%ysum = zeros(1,L) % create a zero table that is the size of the expected array
Msum = 0;
for i = 1:z; % this loop from spot 1 of the array inputed all the way to the end
a = amultiple(i); % indexes i for amultiple array
F = Fmultiple(i); % indexes i for Fmultiple array
%c = c + 1
M = []; % reset y each round
I = (w .* (h .^3)) ./ 12;
R = (F ./ L) .* (L - a);
theta = ((F .* a) ./ (6 .* E .* I .* L)) .* ((2 .* L) - a) .* (L - a);
%if c > 0
% y = []
x = linspace(0,L,1000);
for n = 1:length(x)
if x(n) <= a
def = (-1 .* theta .* x(n)) + ((R * x(n) .^3) ./ (6 .* E .* I));
M = [M, def];
else
def = (-1 .* theta .* x(n)) + ((R * x(n) .^3) ./ (6 .* E .* I)) - ((F ./ (6 .* E .* I)) .* ((x(n) - a) .^3));
M = [M, def];
end
end
Msum = (Msum + M);
% ysum(c,:) = y
% end
end
MaxMin = abs(min(Msum))*1000; % finds the greatest minimum value and takes the absolute value of it
fprintf('The maximum deflection of the beam is %0.3f [mm].', MaxMin);
figure(2)
plot(x,(Msum.*1000));
x = linspace(0,L);
grid on;
xlabel('Length of the Beam [m]')
ylabel('Deflection [mm]')
title(sprintf('Deflection of %s undermultiple concentrated loads',Material(material_task1)))
loop = menu('Do you wish to repeat multiple loads calculation?', "Yes", "No");
end