Using an array as an output
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a function and the output must be a one-dimensional array consisting of the elements y1, y2, y3, and y4.
Do I have to make a subfunction or nested function in order to define the output?
Simply writing
output=[y1 y2 y3 y4]
does not work.
2 commentaires
per isakson
le 24 Sep 2017
Modifié(e) : per isakson
le 24 Sep 2017
"Simply writing [...] does not work". If "the elements y1, y2, y3, and y4" are scalars I cannot see why it shouldn't work.
Réponses (1)
Gaige
le 5 Oct 2023
I would need to see all the code to be sure. Did you try seperating the elements with a coma, and was output the return falue of the function?
0 commentaires
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!