Going from [ a b c ] to (a, b, c)

Hi
I'm new to MATLAB and in need of a bit of help.
I have a custom made function that needs input as follows:
func(a,b,c)
I have the variables in the following form:
var = [ a b c ]
How do I get the variables into the form the function needs? or alternatively change the form of input of the function?

 Respuesta aceptada

Paulo Silva
Paulo Silva el 15 de Jun. de 2011

1 voto

func(var(1),var(2),var(3))

2 comentarios

Morten Jensen
Morten Jensen el 15 de Jun. de 2011
thank you
Sean de Wolski
Sean de Wolski el 15 de Jun. de 2011
You could edit the custom function to except only one value and then parse it as Paulo has done internally - it'll look cleaner.

Iniciar sesión para comentar.

Más respuestas (1)

Categorías

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by