Reputation
72,301
Next tag badge:
595/400 score
76/80 answers
Badges
5 179 407
Newest
 Enlightened
Impact
~850k people reached

Jul
2
comment Contourplot fails to plot x==0 if plot range is from 0
I do understand that some function are simply not defined outside of the boundary, but for others PlotRange should be a good workaround.
Jul
2
comment Contourplot fails to plot x==0 if plot range is from 0
ContourPlot subdivides the region into smaller and smaller parts to localize the contour. It's a good idea to make sure that any feature you need discovered by ContourPlot should be in the inside of the region, not on the boundary. What is shown in the figure can always be restricted using PlotRange later. Use PlotRange to control what is shown, use the x and y bounds to control what is computed.
Jul
2
comment Trainable WEKA segmentation of images
Fiji being a Java library, maybe you can access it though J/Link
Jul
2
revised MaxValue of a periodic function
added 1 character in body
Jul
2
comment What function generates random numbers in a compiled function?
@Felix Extracting an element from an array, i.e. numbers stored sequentially in memory in a flat format, takes the same amount of time regardless of the size of the array.
Jul
2
answered What function generates random numbers in a compiled function?
Jul
2
comment What function generates random numbers in a compiled function?
@Felix You can make C++ functions accessible from Mathematica through LibraryLink. This does take a bit of work, but once you've got used to it it's not so bad. This is now the usual way for me to call C++ code (I hate writing to files using newly invented formats and importing the data back). Of course if it's fast enough in pure Mathematica that's much less trouble.
Jul
2
comment What function generates random numbers in a compiled function?
That said, your question is valid and interesting, but given your motivation for asking it: I'd just use a C++ library.
Jul
2
comment What function generates random numbers in a compiled function?
Why don't you use a C++ library, e.g. Boost.Random? It is not generally true that rand() from the C standard library is not good enough. Some implementations are good, some are not so good. The problem is that the implementation you get depends on the system/compiler you use. If you use Boost.Random or a similar library you'll know which precise implementation you have and you'll even have a choice of several different implementations.
Jul
2
answered MaxValue of a periodic function
Jul
2
comment Multiplying three matrices does not give expected form
Yes, it's a generalized scalar product that works between arrays/tensors of any dimension, not just matrices. For matrices it's equivalent to matrix multiplication. Contrast this with e.g. MATLAB, which originally supported only matrices and nothing else. MATLAB still doesn't support vectors (1D arrays), only row-matrices or column-matrices. Mathematica does have true 1D arrays and doesn't have the strict matrix-oriented view that MATLAB takes.
Jul
2
comment Multiplying three matrices does not give expected form
One needs to be careful when just typing classical mathematical notation into Mathematica. Sometimes Mathematica can interpret it, sometimes it can't. When it can, it might not use the interpretation you meant. It's better to treat any Mathematica input as program code, not human-readabale mathematical notation, and use unambiguous notations. The palettes are for mathematica notation mostly. But in this case the only change necessary is . really, the matrix notation is not harmful in any way.
Jul
2
comment Multiplying three matrices does not give expected form
The problem is that * is element by element multiplication and only works for arrays of the same dimensions. . (i.e. Dot) is used for matrix multiplication. Using $1\times n$ and $n\times 1 $ matrices for row and column vectors is not a problem, but not necessary either. For a vector you can just write {x,y,z} and not distinguish between row and column vectors. The order of multiplications (vec.mat vs mat.vec) determines what will be done.
Jul
2
comment Multiplying three matrices does not give expected form
You need to post Mathematica code, not LaTeX. Otherwise it's impossible to tell what's going wrong. Also be sure to type "matrix multiplication" in the documentation search box and see what comes up.
Jul
2
comment Median of Dataset in Mathematica 10
Another way is Transpose[dataset][All, Median].
Jul
2
comment Median of Dataset in Mathematica 10
This kind of makes sense because the median is defined based on ordering of the elements. Vectors cannot be ordered, thus mathematically the median of vectors makes no sense. Median does have the convenient behaviour that for a list of vectors Median[list] gives Median /@ Transpose[list] though.
Jul
1
comment Simple ways to implement vector dilation
@Rahul Thanks again, I managed to come up with a robust solution by making some minor modifications to your line. I'll post later tonight when I get the time.
Jun
30
comment Simple ways to implement vector dilation
@Rahul Unfortunately for my actual use case it just gives up :( I'll post a better example tomorrow, no internet connection at home and I need to leave :(
Jun
30
comment Can I rely on the ordering of the adjacency matrix?
@SjoerdC.deVries That's correct AFAIK, I was too lazy to point that out. However, if the vertex list is not explicitly given then in the current version it just takes the order of vertices as they first appear in the edge list. In future versions, who knows?
Jun
30
revised Why don't the arrowheads show for this directed graph?
added 3 characters in body