Function to calculate two different output variables
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Stephen23
am 23 Mär. 2018
@hi hey: what is your question?
How to define functions is covered in the MATLAB documentation:
Antworten (0)
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!