r/Python • • Aug 05 '19

Python's response to MATLAB

Post image
4.3k Upvotes

372 comments sorted by

View all comments

Show parent comments

-3

u/mexiKobe Aug 05 '19

It’s self-explanatory though. If you set i or j equal to something else.. that’s what it will equal.

10

u/Eurynom0s Aug 05 '19

Again, Matlab is targeted at non-programmers, which is the kind of audience you might expect to assume that the scope of the ijk being used as loop variables is restricted to the loop.

0

u/[deleted] Aug 05 '19

[deleted]

5

u/Eurynom0s Aug 05 '19

This isn't really specifically about programming. In math and physics textbooks, you often see the unit vectors given as i j and k (instead of x y and z); vector/matrix indices will often be given ijk in a subscript; you'll often see triple summations with i on one, j on the second, and k on the third; etc. So the audience Matlab is intended for is going to want to loop over ijk (xyz) since it matches the notation they're used to using.

→ More replies (1)