MATLAB: How do you check if an inputed number is an array/vector or just 1 value

callerror checkingfunctionMATLABvectors

Using function [a, b, c, d] = function_name(a,b,c,d)
I know that if it's an array, [] will be used in the input and the script will have to call a position of an array eg. y(1) or y(2)
If it's a discrete value it will just be y
Basically, instead of calling 1 value of a, i want to call 2 or more, etc
I don't know if that makes any sense, but it would be very helpful if someone could please just help me out.

Best Answer

You can use size to find the number of components in each variable, e.g.:
size(a)