MATLAB: How to define new methods on existing matlab classes

oopoverloading

Hi, I would like to define, for my own use, new methods for some matlab classes such as cell, struct, among others.
for instance I would like to be able to do
c=a+b, where both a and b are cell arrays.
Is there any way to do that?
Thanks

Best Answer

You could create an @cell folder and in it create a plus method. Or you could use celladd like Sebastian suggested which is probably a better and faster idea. If you're specifically interested in adding cells, then look into gadd already written in the Neural Network Toolbox.