Consider the following Matlab script.
a) Is any of the variables used in this script of array (vector) type? If so, give the name(s) of the variable(s).
b) What is the term 'length(a)' used for?
c) What is the numerical value for the variable 'tot' at the end of this script?
d) Rewrite the given script such that the 'for' loop breaks when 'tot > 5'.
clear all;
a = [1,2,3,4,5];
tot = 0;
for i = 1 : length(a)
tot = tot + a(i)^2;
if tot > 5
break;
end
end
% Print the numerical value for 'tot' to the screen
tot