For MATLAB accidents that lead to interesting results
Add any funny or fancy code that you got doing MATLAB stuff
The following accident are included:
Author: Ander Biguri
Medium: Arithmetic Bug on gif
Level-set algorithm attempting to segment a 3D volume of a CT scan of a human thorax. An opposite sign generates a trippy biologically looking image while still partially segmenting the bone structure.
Author: Ander Biguri
Medium: Indexing/Arithmetic Bug on gif
A miserably failed attempt to generate projections from tetrahedra meshes. Error unknown.
Author: Ander Biguri
Medium: Arithmetic Bug on png
Split-Bregman globally convex segmentation misses a sign, decides to go full sabanah horse.
Author: Ander Biguri
Medium: Indexing Bug on png
Triangles look very nice when plotted, but the importance of a -1 in the code can not be ignored, as this crude representation of aberrant indexing shows.
Author: Ander Biguri
Medium: Mathematics on png
When the derivatives are wrong, the gradient goes to hell (or in that general direction). The solution is be in the center.
Author: Ander Biguri
Medium: Floating point accuracy on png
Look, I needed all those decimals, and float32 was not giving me all those decimals. Decimals are what I wanted. Lots of them.
Author: Ander Biguri
Medium: Indexing error on png
Sometimes bad indexing just generates pretty images. Just that, just pretty images.
Author: Adriaan
Medium: Colormaps on png
Maybe a different colormap represent better this isolines of the covariance? Maybe.
Author: Dev-il
Medium: png
USA looked different in my school maps.
Author: Luis Mendo
Medium: Too many things on png
One cornu was good, by why not just put more?
Author: Luis Mendo
Medium: Too many things on png
Each line represents the complex-plane trajectory of a multipath fading process, generated as complex correlated Gaussian noise. I meant to plot the absolute value as a function of an implicit time index, i.e. plot(abs(x))
(equivalent to plot(1:size(x,1), abs(x))
), but I mistakenly did plot(x)
, which draws the paths on the complex plane (and gives a prettier result).
Author: flawr
Medium: Wrong inverse of geometric transform on png
These lines should form a rectangular grid. Turns out the inverse I computed doesn't actually invert the original function.
Author: flawr
Medium: mixed sign- and off-by-one errors
The shape in the first picture is supposed to be a unit sphere. The coordinates should have been normalized by v = v/norm(v)^1
, instead they were normalized by v=v*norm(v)^2
. The second picture shows an attempt to fix it by doing v = v/norm(v)^4
.
Author: flawr
Medium: matplotlib doesn't do intersections
This was ported from MATLAB to python, but unlike MATLAB, matplotlib doesn't automatically compute intersections of 3d polygons - at least not with the method used.