MATLAB: Function

function

I am trying to call another function(add) from within my code but i get the following error. Can any one please help.
a=[1 2 3 4 5 6]
[b]=add(a)% the commands of add actually produces d
c=a+d
??? Undefined function or variable "d".

Best Answer

No. The command add may produce 'd' in its own function workspace, but when it is retrieved it is called 'b' because that's the variable name you're assigning it to.
Did you want:
d = add(a); ?
Or did you want add to put a d in your workspace?
doc assignin