function [first, middle, last] = fml(x)
%FML Returns the first, middle, and last element of x
first = x(1);
last = x(length(x));
middle = x(length(x))/2;
if mod(length(x),2)==1
middle = (x(length(x)/2+1)+x(length(x)/2-1))/2;
elseif mod(length(x),2)==0
middle = x(length(x))/2;
end
——— It is not working for some reason. Getting errors at the IF sequence.
Best Answer