Reputation: 490
I want to write a function that does some image processing and writes the processed images to files. I don't want it to return anything. I can always return a dummy variable which can be ignored, but I'd like to keep my code clean. How can I achieve this in MATLAB?
Upvotes: 23
Views: 35554
Reputation: 2786
Yes.
function [] = my_awesome_function(image,filename,other_inputs)
% Do awesome things.
end
will return nothing. An even simpler version:
function my_awesome_function(image,filename,other_inputs)
% Do awesome things.
end
is equivalent.
Upvotes: 54