Since I’ve been using Maxima (circa 2016), I’ve occasionally missed some little feature from matlab and coded up a replacement for maxima, with a corresponding blog piece here at the Maximalist.
Some examples are find(), diff(), pause(), size(), cumsum(), diag(), and a few list indexing utilities. Also a help() utility that mimics matlab.
Here’s a mac file with all of those in one easy-to-load place: matlabesque.mac
Its help() entry reads like this:
matlabesque.mac contains: find(exp) ithruj(L,i,j) indexby(L,indexlist) matlab_diff(L) pause([options]) cumsum(l) size(M) diag(M) - - for any of the above functions, help(function_name) returns help lines for function_name
2 thoughts on “Collecting all my little matlab-like Maxima widgets in one place”
These look handy! Some small suggestions:
For a variable to be local within a block, you need to write block([var],…). Writing block(var:…) assigns a value to var globally.
You should rarely if ever need to use eval_string/simplode in programming. I suggest you rewrite find by recursing on the structure of the expression, not its string representation.
You don’t need to write sequal(oo,”=”) or sequal(oo,”<") etc. You can instead write member(oo,["=","<", …])
Here's a simpler way to define cumsum:
Hope this is useful.
Thanks Stavros! I always learn so much from you 🙂
I’ll make changes based on your excellent suggestions.