MATLAB: Hello What does this command perform in MATLAB? now_time=f​eval(char(​protocol(p​no)),-1); Of course, before this line, this command is written: protocol = { ‘paloha’ …%pure ALOHA : pno=1 ‘saloha’ …%slotted ALOHA: pno=2

Hello
What does this command perform in MATLAB?
now_time=feval(char(protocol(pno)),-1);
Of course, before this line, this command is written:
protocol = { 'paloha' ...%pure ALOHA : pno=1
'saloha' ...%slotted ALOHA: pno=2
'npcsma' ....%np-CSMA : pno=3
'p_persistent' ...% p_persistent pno=4
};

Best Answer

If pno is 1 then that code executes the function named paloha. If pno is 2 then that code executes the function named saloha. If pno is 3 then that code executes the function named npcsma. If pno is 4 then that code executes the function named p_persistent .
In each case, the chosen function is passed the single argument -1
Related Question