Is plhs[] preallocated to some size?
Specifically, if the user hasn’t provided any output args, can I still assign to plhs[0]? plhs[i], i>0?
Or should I check nlhs to see that there’s the appropriate amount of output args?
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.
plhshas the size given nynlhs. Except, ifnlhs == 0, you may assign toplhs[0]in order to provide a value forans– if you want so.There are functions which differentiate between “targetless” calls and calls with assignment. E.g.,
a = pathdoes other stuff thanpath, whilesum([1 2 3])does the same asa = sum([1 2 3]). This said distinction is the reason for that.