Reputation
4,222
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
1 10 30
Newest
 Good Answer
Impact
~52k people reached

12h
comment Matrix multiplication for higher dimensional matrices
to clarify here, MatrixForm is a display function. it's used to show your results as a matrix, but is not used during calculations. you don't need to tell Mathematica "hey this is a matrix" because any rectangular list of lists is as good a matrix as you need. for example Det[{{a, 1}, {Graphics[Disk[]], d}}] will give an answer. this is a deliberate design feature. in particular, it means that all the functions you use for dealing with lists (such as Reverse) can also be used directly on matrices... and vice versa.
19h
comment Graphics3D artifact in Mathematica 10.1 64bit Home Edition - Windows 7?
could it be some kind of post-evaluation function that has attached itself to Graphics3D outputs that puts them in Pane? i don't remember what the commands are but the setting might be somewhere in AbsoluteOptions[EvaluationNotebook[]]. Actually, if this is the case it should be visible if you // FullForm the graphics3D output.
1d
comment How to create a thick spiral then extract the coordinates from the image?
Just as an addendum, ImageCrop[image] is useful for cutting back exactly after over-padding (such as with PlotRangePadding in this case).
1d
comment Graph, overlapping vertexlabels
This is probably the one failing of Mathematica's graphs presentation so far (poor handling of labels). Otherwise it's really pretty. Hopefully they improve labeling in the future. A couple things I would try here: Increasing/decreasing the ImageSize of the graph, as the labels don't scale in proportion to it. Removing the vertices altogether to get a cleaner graph, also fading down the edges a bit.
1d
comment Using function to transform a list
Here is a version of the code to show a few different things/tricks: Fcoord[{n_, s_}] := Module[{x, y}, {y, x} = 100*If[Divisible[n, 30], QuotientRemainder[n, 30] + {1, 0}, {Quotient[n, 30], 30}]; s /. { "I" -> {x, y}, "II" -> {-x, y}, "III" -> {-x, -y}, "IV" -> {x, -y}}]; Fcoord /@ {{242, "I"}, {56, "IV"}} Note that Mathematica has functions for a bunch of stuff, even for things you would normally think are too specialized.
1d
comment Using function to transform a list
oh i see. it's because function parameters are "literal" pattern replacements (they aren't really variables), so when you type coord[[1]] = x inside, the system sees it as {300,II} = x when it is applied. there's ways around this, but i would recommend using Map as you are attempting to. Map isn't designed to modify the original list, it always gives you a completely new list. lots of $$ goes into making this inefficient-sounding thing efficient, so generally you shouldn't worry about performance with something as basic as Map. Also take a look at functions such as NestList.
1d
comment Using function to transform a list
on first glance, you are using = (assignment) where you mean == (equality) ?. by the way it's good that you're trying to go with Mathematica's style. it may take a while, but it will pay off.
1d
comment Curvature Application
@nikie by chance have you written any books? if you wrote an "image/data processing/analysis in mathematica" book, i'd buy it (as long as it was not more than $85).
2d
comment How to create a thick spiral then extract the coordinates from the image?
@Solarmew no problemos. i'm guessing Binarize is choosing a different background based on some threshold, or something like that. Just use ColorNegate to get the polarity you need. For the cropping issue you could adjust the PlotRange but the easiest is to set a padding: PlotRangePadding -> 3. By the way, you can do something like ComposeList[{Binarize, ColorNegate, ImageData, MatrixPlot}, plot] // Column to follow these kinds of sequential transformations.
Jul
1
comment How to create a thick spiral then extract the coordinates from the image?
do you mean just PolarPlot[theta/2 Pi, {theta, 0, 2 Pi}, PlotStyle -> {AbsoluteThickness[8], CapForm["Round"]}, Axes -> None] // Binarize // ImageData // MatrixPlot ? by setting large ImageSize you can increase the resolution. you can also use Position[imagedata,1] and ImageValuePositions[im,1] for coordinates
Jun
27
comment Drawing a ladder graph with Line and Table/Array
by the way, FullForm[Normal[Show[GridGraph[{8, 2}]]]]. interestingly, by converting to graphics with either Show or FullGraphics, you can move vertices around and the edges stay connected.
May
23
comment Mathematica's ViewPoint versus MATLAB's View command
@Guesswhoitis. you're right ty. fixed. i am dyslexic with respect to mathematica 3D view specification parameter names.
Aug
8
comment Start Mathematica without the menu bar?
¡¡ WE DID IT REDDIT !!
Dec
31
comment Get DownValues that do not involve patterns?
one way of extracting the inputs/outputs: Cases[DownValues[f], (_[Verbatim[f][value : Except[_Pattern]]] :> result_) :> (value -> result)] (general note: i figure this out by using FullForm. e.g. FullForm[x_] => Pattern[x, Blank[]])
Dec
26
comment How to generate a random snowflake
i just noticed this isn't particularly in line with what OP was looking for. i don't think it'll hurt anyone though and it's in the Christmas spirit
Dec
26
comment How to generate a random snowflake
some of those remind me of snowflakes i've seen on other planets. ah the memories
Dec
20
comment Module that finds the sum of digits of any given positive integer
@rola please see my answer to this question. it's important to understand that Mathematica's syntax is very "raw", in that there are no keywords. Module is not a keyword. it's a regular symbol/function that you could make your own version of. the important syntax is :=, which expects a pattern on the left and basically anything you want on the right. the purpose of Module is to create local variables. if you don't need local variables then you don't need Module, you can just write the expression, or e.g. f[x] := (Print[x]; x)
Dec
20
comment Module that finds the sum of digits of any given positive integer
@rola Look in the Mathematica documentation (F1 button in Mathematica), it is very useful. Total is basically the same as Plus @@ # & which is the same as Apply[Plus, #] &. The main difference, I suppose, is that Total allows you to specify the level (for example you can add up all the elements of a matrix, instead of its rows).
Nov
30
comment Pasting monospaced text into Mathematica notebook destroys aligment
maybe i'm being an idiot by bringing this up, but you can do some basic vector editing (by hand) in Mathematica
Sep
20
comment Raster with ColorFunction is blank when Dynamic Updating is disabled
@AlexeyBobrick Yep, I lowered the number of kernels. But I don't know if that is a general solution. As I wrote in the update, the problem appears to have something to do with the way Dynamic interacts with Rasterize, which is most likely an actual bug. Look at this thread which deals with the underlying Dynamic problem. I don't know why the number of kernels has an effect.