MATLAB: What is status for

status calling a function

I've read many codes that when calling a function it equals to status. Like this:
[status]=function(s)
What is the status for?

Best Answer

See movefile. Checking the status allows to check for errors:
[status,message,messageid] = movefile(File1, File2);
if ~status
warning(message)
end
Now a warning appears, but it could be an error also. E.g. the destination could be write protected.
Equivalent for mkdir. Here the use of the status and the messages is explained in the documentation also: doc mkdir.