# online and offline machine learning representation in MATLAB

what is the difference between offline and online learning considering that the program will be made with matlab .. and please check the following matlab code , does it fall into one of those two categories?

function y = Perceptron_online(inputs,dest,iterations,Bias)
w = rand(1,size(inputs,2));
i=0;
while (i<iterations)
output = sum(w.*inputs)+ Bias;
if sign(output)~=sign(dest)
diffW = dest.*inputs;
w = w + diffW;
diffBias = dest;
Bias = Bias + diffBias;
end
i=i+1;
end
y=output;
end


Such code looks like a Perceptron, which can be used in online classification but you should specify what input and output are.
If input is the data matrix and output is the known labels vector, you can work in an online fashion by removing the iterations and simply scanning the data matrix, that is (for every jth example):