Redifining + function in matlab
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I would like to redifine '+' function in MATLAB. Well my intention is not exactly to redefine +, instead I would like to create a new function ++ or $$ that would do the computation I need. Is this possible? I tried to define it as a function but merely defining as function doesn't help since it doesn't take such characters as function name. Is it possible to define a class of functions like ++ or or what ever, that can do the function I need?
0 Kommentare
Akzeptierte Antwort
Lucas García
am 28 Aug. 2011
You should check object oriented programming with MATLAB and how to overload operators like '+'.
To start with:
3 Kommentare
Lucas García
am 29 Aug. 2011
That's right, thanks for the clarification Walter. Only existing MATLAB operators can be overloaded. Unless you are are using the Symbolic Math Toolbox in MuPad, but that's a whole different story...(http://www.mathworks.com/help/toolbox/mupad/stdlib/operator.html)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Construct and Work with Object Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!