Function to calculate two different output variables
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Stephen23
el 23 de Mzo. de 2018
@hi hey: what is your question?
How to define functions is covered in the MATLAB documentation:
Respuestas (0)
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!