Behavior with unspecified output arguments
Mostra commenti meno recenti
I am a bit puzzled by the behavior I see in the below example. I thought Matlab will always check that a function call assigns any explicit outputs that it defines. Because the signature line of func() does not use varargout, but instead the explicit output t, shouldn't an error message occur in the first line even though func is not called with an explicit output argument? Has it always been this way?
func(0,0) % Why doesn't this produce an error?
c=func(0,0)
function t=func(a,b)
if b>0
t=a+b;
end
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Calendar in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!