Why doesn't MATLAB have +=, -=, *= ?

eLiu

Diamond Member
Jun 4, 2001
6,407
1
0
Don't get me wrong... I love matlab, but does anyone know why they don't have +=, -= or *= operators?

They're so convenient! And if you have a complex indexing scheme or something, you don't have like:
A(junkjunkjunkjunk,junkjunkjunkjunk2) = A(junkjunkjunkjunk,junkjunkjunkjunk2) + 3;
instead,
A(junkjunkjunkjunk,junkjunkjunkjunk2) += 3;

Isn't that nice? C'mon mathworks, what's the deal :(

-Eric
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
You can always use
for i=1:3:50
***
end
to increment by 3. There's more than one way to skin a cat.
 

eLiu

Diamond Member
Jun 4, 2001
6,407
1
0
I mean the incrementing by 3 is arbitrary. There coudl be some other expression there. The point is that in order to update a part of an array/matrix (example: working with a block-diagonal matrix with non-uniformly sized blocks), I have to type out the indexing twice. It's just a pet peeve/whine, not really any real trouble, lol.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Originally posted by: eLiu
I mean the incrementing by 3 is arbitrary. There coudl be some other expression there. The point is that in order to update a part of an array/matrix (example: working with a block-diagonal matrix with non-uniformly sized blocks), I have to type out the indexing twice. It's just a pet peeve/whine, not really any real trouble, lol.
Yeah, I know. I've been programming MATLAB for years and am now trying to switch over to C/C#. Trying to deal with arrays in C is like pulling teeth compared to MATLAB - they both have their strengths and weaknesses I suppose.
 

tatteredpotato

Diamond Member
Jul 23, 2006
3,934
0
76
I've used Maple... I think it's more similar to Mathematica than Matlab, but my experience with both the others is very limited.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Originally posted by: ObscureCaucasian
I've used Maple... I think it's more similar to Mathematica than Matlab, but my experience with both the others is very limited.
Maple is similar to Mathematica, but its symbolic functionality is completely contained within the MATLAB symbolic manipulation toolkit (i.e. the toolkit actually calls Maple functions).