A = imread(filename, fmt)
[X, map] = imread(...)
The above is in the synopsis part of imread, which seems to say that the return value of a MATLAB function depends on how it’s called? Is that true?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
IMREAD function is defined as
In your 2 examples A and X will be the same, but in the second case there will be additional variable
map.There is a way in MATLAB to define variable output if you use VARARGOUT in function definition:
So you can output different values based on some condition in the function body.
This is a silly example, but it illustrates the consept:
Then
The output arguments can be even different data types.
Another example with condition based on number of output variables:
Then