How to have an arbitrary vector as your input for your function?
Mostra commenti meno recenti
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!!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Argument Definitions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!