I have the following working function (a). This function is responsible to solve error within another function.
function [a] = algorithm1(z)
if (z==0)
j=1;
a=j;
disp('Your computer is switch on from state offline')
elseif (z==1)
j=1;
a=j;
disp('Your computer is working properly')
elseif (z==2)
%j=2; Value 2 for status of rebooting
disp('Your computer is rebooting')
j=1;
a=j;
disp('Your computer is working properly after rebooting')
else
disp('unidentified error')
end
end
My problem is how to make another function(b) that will take the function(a) above as its solution. I was hoping it would come out like this
T=100 status 1, your computer is working properly
T=101 status 1, your computer is working properly
T=102 status 2, your computer is working properly after rebooting
.
.
.
T=200 status 1, your computer is working properly
The T is a looping function and the status function(b) is generated randomly. How can I give function (a) to function (b) so that it will continously solve error using function (a).