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

 Akzeptierte Antwort

Jan
Jan am 27 Feb. 2013
Bearbeitet: Jan am 27 Feb. 2013

0 Stimmen

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.

Weitere Antworten (2)

Doug Hull
Doug Hull am 26 Feb. 2013

0 Stimmen

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 Kommentar

chaos4u2
chaos4u2 am 27 Feb. 2013
Could you give me an example please, I don't see the difference between using it and don't using it. Thank you!

Melden Sie sich an, um zu kommentieren.

rajashekar chava
rajashekar chava am 5 Sep. 2021

0 Stimmen

status(1)=!

1 Kommentar

Walter Roberson
Walter Roberson am 5 Sep. 2021
This is not valid syntax in MATLAB. The ! operation is only valid at the beginning of a command.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Report Generator finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 26 Feb. 2013

Kommentiert:

am 5 Sep. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by