How to switch between two different functions
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to write a function in which i can switch between two different functions called linear & joint, both are an array of six. Now the function only needs to switch when the linear or joint arrays are unchanging. I was thinking about using the switch functions and placing cases but didn't know how to quite implement it. Can anyone help?
2 comentarios
the cyclist
el 24 de Mzo. de 2012
It does sounds like a switch statement is what you need. I did not understand what you meant by "when the linear or joint arrays are unchanging". Also, I am a bit confused when you say that are functions, but also they are an "array of six". You might want to lay out a bit more detail. Finally, if there is someone who might be able to help you with the English, that might help, too.
Respuestas (1)
Rick Rosson
el 24 de Mzo. de 2012
switch whichFunction
case isLinear
y = linear(x);
case isJoint
y = joint(x);
end
3 comentarios
Walter Roberson
el 29 de Abr. de 2012
Perhaps
case 'isLinear'
and
case 'isJoint'
would be clearer for this purpose.
Ver también
Categorías
Más información sobre Measurements and Spatial Audio 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!