Kozyarchuk
Kozyarchuk

Reputation: 21827

What is the equivalent to += in Matlab?

Is it possible in Matlab to increment a value of a variable without restating it on the right hand side of the statement?

Upvotes: 22

Views: 29585

Answers (2)

zw324
zw324

Reputation: 27180

AFAIK, there's no such thing in MATLAB.

And this is understandable(look at Steven Lord's answer, post 11).

That post indicates that since MATLAB is array based, such operator would be ambiguous and unintuitive, at best.

Upvotes: 19

Ben Voigt
Ben Voigt

Reputation: 283624

MatLab doesn't have compound assignment, but the open-source clone Octave does.

Source: http://hyperpolyglot.org/numerical-analysis

Upvotes: 7

Related Questions