Julia for Matlab and Python Users (Updating)
Motivation Julia is a very fast language.
Julia hybrids many features from many sources. Here I’m taking note on its syntax and features by comparing to Python and Matlab.
Basic Functions print is like in python BUT, no \n added at the end of each line. println has the \n String formatting is super easy, we can just use values of expressions. "$greet, $whom.\n" "1 + 2 = $(1 + 2)" Operators . operation extend its usage in matlab it means to vectorize sth. or broadcast one operation to all the element of the argument. This is super powerful, extending beyond arithmatics. You can broadcast everything by putting a . there. ... is like * in python, it could de-bundle a tuple or list into lots of variables. Types :: signify the type of sth. <: signify the type is a subtype of X. nothing equiv to None in python Similar to matlab true false not capitalized. Control Flow Control flow syntax is much like matlab if...elseif...end no indentation or :. Loop syntax is a bit like Python for .... in ..., with some caveat But if there are two things being looped, there needs to be a () , not like python. for (i,x) in enumerate(L) Functions Syntax is like
Oct 15, 2021