Function to calculate two different output variables
2 views (last 30 days)
Show older comments
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 Comment
Stephen23
on 23 Mar 2018
@hi hey: what is your question?
How to define functions is covered in the MATLAB documentation:
Answers (0)
See Also
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!