Function to calculate two different output variables
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
So originally I started with a code like this:
apples=sweet(core,hot,chicken)
pie=crust(taste,bake,rim)
apples.outside=sweet(core2,hot2,chicken2)
pie.outside=crust(taste2,bake2,rim2)
They both use the functions sweet and crust but and have the same number of input variables. What I want to do is combine them into one function. Here's what I tried to do
First=core,hot,chicken
First_out=taste,bake,rim
Second=core2,hot2,chicken2
Second_out=taste2,bake2,rim2
apples=sweet(first,second)
pie=crust(First_out,Second_out)
So instead of using the function two separate times, I use it once and calculate the input variables at the same time.
1 commentaire
Stephen23
le 23 Mar 2018
@hi hey: what is your question?
How to define functions is covered in the MATLAB documentation:
Réponses (0)
Voir également
Catégories
En savoir plus sur Whos 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!