<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246994</link>
    <title>MATLAB Central Newsreader - Reason Matlab has never implemented incrementation operators?</title>
    <description>Feed for thread: Reason Matlab has never implemented incrementation operators?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 18 Mar 2009 19:47:52 -0400</pubDate>
      <title>Reason Matlab has never implemented incrementation operators?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246994#635967</link>
      <author>klydefrog</author>
      <description>What is the philosophy or reason behind the Mathworks not finally releasing Matlab with a few incrementation operators? (++, +=, etc)&lt;br&gt;
&lt;br&gt;
I'm not asking for work arounds or ways how to write my own function to get the same effect.  I'm just curious why in the world they don't do this.  Seems like it would be a simple thing to do.</description>
    </item>
    <item>
      <pubDate>Wed, 18 Mar 2009 19:57:01 -0400</pubDate>
      <title>Reason Matlab has never implemented incrementation operators?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246994#635968</link>
      <author>us</author>
      <description>klydefrog&lt;br&gt;
&amp;gt; What is the philosophy or reason behind the Mathworks not finally releasing Matlab with a few incrementation operators? (++, +=, etc)&lt;br&gt;
&amp;gt; I'm not asking for work arounds or ways how to write my own function to get the same effect.  I'm just curious why in the world they don't do this.  Seems like it would be a simple thing to do...&lt;br&gt;
&lt;br&gt;
this issue has been discussed many a times in this NG...&lt;br&gt;
for instance:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://groups.google.com/group/comp.soft-sys.matlab/browse_frm/thread/db224fe618c29aac&quot;&gt;http://groups.google.com/group/comp.soft-sys.matlab/browse_frm/thread/db224fe618c29aac&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
    <item>
      <pubDate>Wed, 18 Mar 2009 20:24:09 -0400</pubDate>
      <title>Re: Reason Matlab has never implemented incrementation operators?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246994#635975</link>
      <author>klydefrog</author>
      <description>Thanks.  I saw that thread before I posted, but it was cut off before Steven Lord's response.</description>
    </item>
    <item>
      <pubDate>Thu, 01 Oct 2009 05:00:19 -0400</pubDate>
      <title>Reason Matlab has never implemented incrementation operators?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246994#683853</link>
      <author>Ryan Ollos</author>
      <description>klydefrog &amp;lt;aj00mcgraw@gmail.com&amp;gt; wrote in message &amp;lt;20461488.1237405703543.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; What is the philosophy or reason behind the Mathworks not finally releasing Matlab with a few incrementation operators? (++, +=, etc)&lt;br&gt;
&lt;br&gt;
It would be interesting, given the new object oriented programming capabilities of MATLAB, if it were possible to define operators such as this for your own class.  With that in mind, it would also be nice if one could then implement their own ++ operator for the intrinsic classes.&lt;br&gt;
&lt;br&gt;
I'm fairly sure that this is not currently possible, although I think it is possible to overload the operators that are pre-defined in MATLAB, such as + and - (via `plus` and `minus` methods).  If I remember correctly, I've seen examples of this in pre-2008a classes, but have never tried it myself.</description>
    </item>
    <item>
      <pubDate>Thu, 01 Oct 2009 13:47:42 -0400</pubDate>
      <title>Re: Reason Matlab has never implemented incrementation operators?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/246994#683966</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;Ryan Ollos&quot; &amp;lt;ryano@physiosonics.com&amp;gt; wrote in message &lt;br&gt;
news:ha1d12$log$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; klydefrog &amp;lt;aj00mcgraw@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;20461488.1237405703543.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; What is the philosophy or reason behind the Mathworks not finally &lt;br&gt;
&amp;gt;&amp;gt; releasing Matlab with a few incrementation operators? (++, +=, etc)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; It would be interesting, given the new object oriented programming &lt;br&gt;
&amp;gt; capabilities of MATLAB, if it were possible to define operators such as &lt;br&gt;
&amp;gt; this for your own class.  With that in mind, it would also be nice if one &lt;br&gt;
&amp;gt; could then implement their own ++ operator for the intrinsic classes.&lt;br&gt;
&lt;br&gt;
You can't define _operators_ for your own classes, but you could define your &lt;br&gt;
own _methods_ for a class.  For instance, you could write a method with the &lt;br&gt;
following signature for a handle class:&lt;br&gt;
&lt;br&gt;
function plusequals(obj, x)&lt;br&gt;
&lt;br&gt;
and use it where you would use a &quot;+=&quot; operator:&lt;br&gt;
&lt;br&gt;
plusequals(myobject, incrementdata)&lt;br&gt;
&lt;br&gt;
Of course, depending on how 'fancy' you want to get, you could have your &lt;br&gt;
method accept indices as well:&lt;br&gt;
&lt;br&gt;
function plusequals(obj, indices, x)&lt;br&gt;
&lt;br&gt;
but then you'd have to figure out how you want to handle things like &lt;br&gt;
repeated indices.&lt;br&gt;
&lt;br&gt;
&amp;gt; I'm fairly sure that this is not currently possible, although I think it &lt;br&gt;
&amp;gt; is possible to overload the operators that are pre-defined in MATLAB, such &lt;br&gt;
&amp;gt; as + and - (via `plus` and `minus` methods).  If I remember correctly, &lt;br&gt;
&amp;gt; I've seen examples of this in pre-2008a classes, but have never tried it &lt;br&gt;
&amp;gt; myself.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/f1-6010.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/f1-6010.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
and&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/br02zhv.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/br02zhv.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com&lt;br&gt;
comp.soft-sys.matlab (CSSM) FAQ: &lt;a href=&quot;http://matlabwiki.mathworks.com/MATLAB_FAQ&quot;&gt;http://matlabwiki.mathworks.com/MATLAB_FAQ&lt;/a&gt; </description>
    </item>
  </channel>
</rss>

