MATLAB: Adding vectors: positive single digit values and returning digits of sum as elements of vector

duplicate post requiring mergingvector summation; single digit values

I am trying to write a function that takes two vectors of positive single digit integer values as its input and return the digits of the sum as elements of a vector.
I have two vectors but am unsure how to start a function that will allow me to perform what is listed in the previous statement. If someonme could please help with me a starting po0int, it would be appreciated.

Best Answer

Please give an example to show what you want. It could either be
theSum = vector1 + vector2;
like Matt J suggested, or
theSum = sum(vector1) + sum(vector2);
which will work for vectors of different lengths. Or maybe you want to interpolate them to make them equal sizes before summing - we have no idea what you really want. Don't use sum as the name of a variable like you did because sum() is the name of a built in function and you'll disable it if you use the same name for your own functions or variables.