Why [] appears after a function?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Carolina Silva
le 28 Nov 2019
Modifié(e) : Stephen23
le 28 Nov 2019
What does this means?
0 commentaires
Réponse acceptée
Stephen23
le 28 Nov 2019
Modifié(e) : Stephen23
le 28 Nov 2019
According to the function documentation, those square brackets contain any output arguments. Because the square brackets you show in your question contain zero variables, that function has zero output arguments.
function [A,B,C,D] = myfun(...) % 4 output arguments
function [A,B,C] = myfun(...) % 3 output arguments
function [A,B] = myfun(...) % 2 output arguments
function [A] = myfun(...) % 1 output arguments
function [] = myfun(...) % 0 output arguments
For one or zero output arguments the square brackets can be omiited entirely:
function A = myfun(...) % 1 output arguments
function myfun(...) % 0 output arguments
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!