Morbo
Computer
- Nov 26, 2005
- 1
I'm new to Matlab so have patience.
I am trying to create or find a function that does this (off course for larger rows)
a = [1 3 4 6 7 9]
b = [1 3 4 6 7 9]
c = [1 3 5 9 11 15 7 9]
Now to do this a has to be changed in [1 3 4 6 7 9 0 0] and b to [0 0 1 3 4 6 7 9] so I can do c = a + b. So I create with the function zeros a row [0 0].
Question; How do I add those zeros in front of the row b and at the back of a. I could do it with a loop but that seems like a waste resources. Also if I work with columns how do I add zeros at the top or at the bottom?
thank you in advance.
I am trying to create or find a function that does this (off course for larger rows)
a = [1 3 4 6 7 9]
b = [1 3 4 6 7 9]
c = [1 3 5 9 11 15 7 9]
Now to do this a has to be changed in [1 3 4 6 7 9 0 0] and b to [0 0 1 3 4 6 7 9] so I can do c = a + b. So I create with the function zeros a row [0 0].
Question; How do I add those zeros in front of the row b and at the back of a. I could do it with a loop but that seems like a waste resources. Also if I work with columns how do I add zeros at the top or at the bottom?
thank you in advance.