Functions do not have to have inputs or outputs.
For example, this function below searches for invisible figures and makes them visible,
figs = findall(0,'type','figure','visible','off');
Your function reads an image and displays it in a the current figure or creates the current figure.
It's a poorly written function, though.
- What if 'Lunchmenu.jpg' doesn't exist?
- What if an unrelated figure already exists?
- The function name is really bad and does not describe what the function does.
- It's not clear why those two lines needs to be within a function.