function[prob,flop]=Matlab(a,b)
a=[1,2,3];
b=[7,8,9];
if (length(a)~=length(b))
disp("it doesn't make sense");
end
prob=0;
flop=0;
for i=1:length(a)
prob=prob+a(i)*b(i);
flop=flop+2;
end
disp(prob);
disp(flop);
What is wrong with my code? it only run the disp(prob) and itdoesn't run the disp(flop)
here is what I got
ans =
50
However, if I take % for the function line, it shows
50
6