What is status for?

7 次查看(过去 30 天)
chaos4u2
chaos4u2 2013-2-26
I've read many codes that when calling a function it equals to status. Like this:
[status]=function(s)
What is the status for?

采纳的回答

Jan
Jan 2013-2-27
编辑:Jan 2013-2-27
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.

更多回答(2 个)

Doug Hull
Doug Hull 2013-2-26
To let you know the status, or output of the function. It varies based on each function. Read the doc for each function for details.
  1 个评论
chaos4u2
chaos4u2 2013-2-27
Could you give me an example please, I don't see the difference between using it and don't using it. Thank you!

请先登录,再进行评论。


rajashekar chava
rajashekar chava 2021-9-5
status(1)=!
  1 个评论
Walter Roberson
Walter Roberson 2021-9-5
This is not valid syntax in MATLAB. The ! operation is only valid at the beginning of a command.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Debugging and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by