How to have an arbitrary vector as your input for your function?
Show older comments
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!!
Accepted Answer
More Answers (0)
Categories
Find more on Argument Definitions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!