How to have an arbitrary vector as your input for your function?
Mostrar comentarios más antiguos
Currently have the following snippet of my code:
function output =sort3(A)
A= [a b c]
if (a<=b)&& (b<=c)
if a<b && b<c
output= [a b c]
What I'm trying to do here is be able to input any arbitrary vector (e.g. [1 2 3]) and have the output follow the parameters that are listed within my code. I keep getting the error: undefined function or variable 'a'... I'm super new to Matlab, so how could I fix my code to have it be able to input any arbitrary vector?
Thanks!!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Argument Definitions en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!