9
votes
2answers
227 views
Sum or Product with Exclusions
Is there a built-in feature for handling things like:
$$\sum_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$
and
$$\prod_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$
or should I work out some sort of Do ...
9
votes
1answer
375 views
Exporting a Large Multidimensional Sparse Array
I'm trying to export a sparse array from Mathematica to share with collaborators who primarily use Matlab.
The sparse array in question is 4 dimensional, (72 x 93 x 94 x 172) with ~4M non-zero ...
9
votes
3answers
582 views
Adapt ticks in plot and font in legend
Some of my 2-dimensional data are displayed with a code similar to this:
...
9
votes
1answer
415 views
CUDALink not working on Mac OS X
On my MacBook Pro, I have a CUDA enabled video card, yet Mathematica does not seem to recognize this. For example, following the CUDALink Setup, I get
...
9
votes
4answers
370 views
ParametricPlot3D output without the meshlines
Caveat: Mathematica version 3.0. if (or when) it matters.
I define a 3D-object with ParametricPlot3D, say, the following:
...
9
votes
3answers
283 views
How to format numbers with at least one figure after the decimal point
I'm searching for a way to get Reals formatted with at least one figure after the decimal point. So e.g. 3. should be printed as 3.0 and ...
9
votes
3answers
192 views
Splitting a list in which figures vary from negative to positive
Consider the following list:
data={4078, 256, -1266, -388, 1290, 1368, 1446, 1524, 2};
I would like to split any kind of such list always, when figures turn form ...
9
votes
2answers
223 views
Align Array Plots
I have two ArrayPlots that I would like to align but my "tweaking" failed yet. I would like each "row" to be aligned.
...
9
votes
8answers
685 views
Map and Apply a function on a nested list
I have a list like this:
{{1,2}, {4,2}, {6,4} ... }
I want to replace every second number with a function of that number. For e.g.
...
9
votes
1answer
330 views
CDF and MediaWiki
Recently there was a handful of CDF embedding-related topics. However I would like to ask whether anyone has succeeded in embedding CDF into MediaWiki page?
I've attempted to do so with the Widget ...
9
votes
2answers
856 views
CUDA and GPU hardware and compatibility questions?
We have iMac desktops and have just begun to parallelize computations across them see: Wolfram Light Weight Grid and parallel computing.
This still does not look like it will give us the performance ...
9
votes
1answer
182 views
How to work around incorrect tooltips in plots exported to HTML
This is an issue that I always wanted to investigate but haven't gotten around to solving yet: The tooltips for contour lines in a plot like this can be very useful in the Notebook interface:
...
9
votes
1answer
341 views
How to import date (YYYY-MM-DD) data from a file?
I have a file with data in form {date, value}:
2010-05-19 17
2010-05-20 20
...
9
votes
5answers
797 views
Fastest square number test
What is the fastest possible square number test in Mathematica 7, both for machine size and big integers?
I presume in version 8 the fastest will be a dedicated C LibraryLink function.
8
votes
1answer
218 views
Write C/C++ programs calling Mathematica functions
I need to write a C/C++ program and call some functions in Mathematica especially those like Solve or NDSolve. The problem is ...
8
votes
3answers
456 views
Composing an image with a plot
I'm trying to illustrate the solutions to a textbook problem dealing with quadratic functions.
This will involve plotting a quadratic and overlaying the plot and the image.
Here is the textbook ...
8
votes
3answers
242 views
Dashed mesh behind 3D object
I am trying to create a simple, almost transparent 3D sphere with a mesh that is made of solid lines if they are on the front surface (i.e. if they are directly visible) and of dashed lines if those ...
8
votes
2answers
209 views
Is there a “GrabHand” and “OpenHand” MouseAppearance in Mathematica?
MouseAppearance[Plot[Sin[x], {x, 0, 5}], "LinkHand"]
Unfortunately I cannot get a screen grab to show the link hand but it is a cartoon hand with a finger ...
8
votes
1answer
104 views
How can I get LineLegend to pick up my plot's BaseStyle?
The new legends functionality in version 9 really simplifies creating legends, and it automatically picks up the styles of the lines.
...
8
votes
2answers
192 views
Correct way to generate large data sets (i.e.forward yield curve )
I would like to generate a set of forward yield curve matrix of size 1000 x 100. First I defined my SparseArray of 1000 x100:
...
8
votes
5answers
271 views
How can I find these patterns' signatures?
I think I can explain it best starting with an example. I have the following lists:
...
8
votes
1answer
97 views
Prevent Plus from threading InterpolatingFunction
For an InterpolatingFunction $y:\ \mathbb{R}\to\mathbb{R}^2$, Plus is unaware of this, so when I do any modifications to it in ...
8
votes
3answers
636 views
How to generate a RandomVariate of a custom distribution?
I'm trying to generate a pseudorandom variate out of a custom distribution. Suppose I want define a custom distribution, and for the sake of simplicity I define a Poisson distribution (the ...
8
votes
1answer
121 views
Algorithm used by IsomorphicGraphQ
I'd like to know which algorithm is used to test if two graphs are isomorphic?
8
votes
4answers
289 views
What's fastest way of defining 10^5 down values?
I want to define
isGood[___] = False;
isGood[#] = True & /@ list
where list is a list of several million integers. ...
8
votes
2answers
405 views
ColorFunction in Histogram[]
Let's say I have a Histogram:
Histogram[RandomVariate[NormalDistribution[10, 2], 500]]
and I want the bars positioned to ...
8
votes
2answers
128 views
8
votes
3answers
507 views
Reflect a Plot Object
I have a relatively simple operation I'd like to perform on a plot: I would like to reflect the plot across the x-axis. I do not have any tick labels, so making sure that the labels are not themselves ...
8
votes
5answers
377 views
simplifying $\frac{\log x^a}{a} = \log x$
If one makes the assumptions $x>0,a>0$, then $\frac{1}{a}\log x^a = \log x$. Thus, in Mathematica, Simplify[1/a*Log[x^a], {a > 0, x > 0}] returns ...
8
votes
3answers
358 views
How to remove repeated permutations?
I want to get the Permutations on the elements of a list. Then I'm doing this:
...
8
votes
3answers
2k views
Plotting Partial Sums of Fourier Series
I'd like to plot some partial sums for a Fourier Series problem, but I am not sure if the output I am getting is correct. I want to be able to plot the partial sums and the function on the same graph. ...
8
votes
2answers
5k views
Generate a Unit Circle Trigonometry
Struggling often with Trigonometry I would like to have some code to generate this Unit Circle Trigonometry. Would be of great help when I need to transform some data :
8
votes
3answers
222 views
Problem when defining variable in Mathematica
I'm trying to run this:
domain := {n, 0, 10};
Plot[n, domain]
but it doesn't work. Instead, it generates the message
...
8
votes
3answers
443 views
How to plot layered graphs?
Given a directed acyclic graph, there is always a possibility to plot the graph as layers, where nodes always send edges into one direction (usually down), to successive layers, and never backwards. ...
8
votes
2answers
160 views
Checking from a preemptive evaluation whether a main evaluation is ongoing
How can I programmatically check from a preemptive evaluation whether a main evaluation is currently ongoing?
I need a function mainEvaluationOngoingQ[] so that
...
8
votes
6answers
583 views
Producing cleaner Mathematica output
I asked this in chat and it turns out it would make for a good question make a posting for. I am writing up a handout type notebook and I'd like to have some clean output for presentation's sake.
...
7
votes
4answers
219 views
“Strange” behavior of Rule
According to the Help
lhs->rhs evaluates rhs immediately.
How to understand the output of the following code?
ClearAll@x;
{1, 3.5} /. x_?IntegerQ -> {x}
...
7
votes
1answer
132 views
Mathematica memory management for large arrays
I have come across a weird phenomenon in Mathematica when dealing with large arrays. When generating a list with all the possible subsets of three elements of another list (thus having elements which ...
7
votes
1answer
147 views
How to change brackets in TraditionalForm output
I'm trying to improve TraditionalForm's output by using different brackets when there are more than one. For instance, instead of $u(v(r(b))))$, I'd like to get ...
7
votes
0answers
217 views
How to improve these WASD + mouse look 3D controls?
Insipred by this question and the corresponding answer I've written a code for full-screen exploration of 3D scenes using standard WASD and mouse look controls. Here it is.
...
7
votes
4answers
204 views
How to remove ticks?
I wanted to remove the Ticks in my coding but i can't. Here when i try to remove the Ticks the number also gone. I need numbers ...
7
votes
2answers
138 views
Save notebook without including Front End version information
How can a notebook be saved without including the front end version?
If you open a .nb file, you'll see something like
...
7
votes
1answer
148 views
Changing default ImageSize in the frontend?
I would like graphs to appear somewhat larger in my notebooks (running v8.0.4 on OSX 10.8.2).
Naturally I can specify ImageSize in each individual plot, or drag ...
7
votes
1answer
238 views
Symbolic Integration along contour: branch cut problem?
Context
Following this question on path integrals in the complex plane, having defined again a numerical and symbolic integrator along a path as
...
7
votes
2answers
366 views
Coloring each face of a Cuboid with a different color
Is there a way to color each face of a Cuboid with a different color?
I looked in the help but couldn't find anything. I found this Coloring the faces of a 3D ...
7
votes
3answers
231 views
How to Gather a list with some elements considered unique
I have a list of the form:
list={{0,...},{1,...},{1,...},{0,...},{3,...},{3,...},{0,...},{0,...},{5,...},{5,...},{5,...},{0,...},{5,...},{0,...},...}
So when we ...
7
votes
1answer
185 views
How to wrap this dynamic code inside a Manipulate?
My goal is to set up a Ising-type simulation, where many fast simulation steps are done in the background, and a visualization of the current state is displayed as the simulation evolves, being ...
7
votes
1answer
193 views
Converting other C++ classes to MTensor in LibraryLink
Hopefully this will be a quick question + a quick answer:
Say I have a C++ (or C) code using LibraryLink. I am using a library that defines a specific matrix class, as many numerical libraries ...
7
votes
1answer
272 views
7
votes
5answers
236 views
TableAlignments->Left not working
For a very simple dataset TableAlignments->Left does not work:
...



