xxxxxxxxxx
function my_output = my_function(my_input)
if my_if_statement
fprint("Returning early because of BlaBlaBlablaaa")
my_output = "Banana"
return
% Rest of function here
https://se.mathworks.com/matlabcentral/answers/520317-exit-function-early-and-return-output