Syren - presumably you found sigadd.m from the submission by John Proakis at DSP Using MATLAB. In the Chapter 2 folder (CHAP_02/) there is an example file called ex020200.m which invokes the sigadd function as [x1,n1] = sigadd(2*x11,n11,-3*x12,n12);
where each of the input vectors are 1x13 arrays. I suspect that you will need to do something similar in your example. The n1 and n2 inputs (your 2 and 3) should be arrays such as
n1 = [1 2 3];
n2 = [0 1 2];
with
sigadd([2 5 7],[1 2 3],[3 2 6],[0 1 2])
producing the desired output of
Try the above and see what happens!
Best Answer