# All Questions

140 views

### Replace rule does not match

I have the following expression -3 I Ez Re[Ex] + 3 I Ex Re[Ez] And I wish to write this in the form ...
507 views

### How to convert between various ItemSize/ImageSize units?

How can one convert between the implicit units used by Grid (ems and line height for horizontal and vertical dimensions) and printers points (in ...
355 views

### Mathematica: Retrieving PlotRange from Histogram

I know that one can retrieve PlotRange of a plot by using AbsoluteOptions[plot,PlotRange] but that won't work on Histogram. Here an example: ...
1k views

### How to distribute proprietary Mathematica code

If I want to make package-code completely unreadable, in a way that the end-user can only call my functions, but has no way to re-engineer my definitions, how would I do that? I know I can use ...
1k views

### How can I create a function with optional arguments and options?

Is it possible to create a function with optional arguments that also takes options? Here is a simple example. I have a function f with option "g". It also has ...
203 views

### How can Magnify be forced to ignore the notebook's window width?

In a new notebook, I can illustrate how the action of Magnify is cut off by the window width: ...
174 views

### Setting a lower limit on calculation time

Sometimes it can come in handy to set a lower limit for a calculation. Consider for example an animation that is generated by some infinite loop, which would run way too fast to display properly for ...
605 views

### Is there a more elegant and efficient way to write brainf*** style loops in Mathematica?

I'm having some fun writing a brainf*** interpreter in Mathematica. See this wiki article for more info. It works nicely but I'd like to find an elegant, preferably functional, way to handle the ...
671 views

### Mathematica: Label specific vertices in GraphPlot

How can I label particular vertices in GraphPlot? And have the arrows space out accordingly, for the width of the label? I have Mathematica 7, but I think this question applies to all versions. ...
1k views

### How to change step size of ListPlot

The command ListPlot will plot lists with a unit step. Is there any way to change the step size of this?
245 views

### PrintTemporary in ParallelTable

I thought of a possible answer to Monitor doesn't work with ParallelTable but it doesn't work as I hoped it would. This accumulates print cells instead of deleting them as intended. Can it be ...
759 views

### Monitor doesn't work with ParallelTable

I can't monitor ParallelTable: Monitor[ParallelTable[Pause[3]; i, {i, 1, 10}], i] just displays i until it is finished. Do ...
6k views

### Exporting graphics to PDF - huge file

I want to draw some basic surfaces, export them to PDF and include them in a LaTeX file. I create a simple 3D graphics object, for instance with ...
177 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 ...
432 views

### Solution Curves and Order of Evaluation Question

I'm new to Mathematica, so I thought I'd try to exercise some solution curves. Consider a simple first order ODE: $y'(x)=\cos(x)$. We know the solution will be of the form $y = \sin(x)+c$ I ...
540 views

### Can someone explain this snippet: (#[#] &)[#[#][#] &]

A friend showed me this snippet of code today: (#[#] &)[#[#][#] &] I can sort of see that we're constructing an anonymous function that takes a function ...
368 views

### Text in columns

So far I've only seen the front end work in a one-cell-below-the-other manner, so I am probably not expecting much of this question, but here it goes. Is there any way to create a document with text ...
340 views

### Can't use CUDA shared memory

CUDALink is properly installed and up to date, all built-in functions work fine, and all little functions I did worked fine... Until I tried using shared memory. The only example I found on the help ...
3k views

### Recovering data points from an image

Unfortunately, some data can only be obtained in picture form (Japanese publications anyone?). Since this cannot be worked with, it has to be converted to a dataset that can; I was wondering whether ...
236 views

980 views

### How to abort on any message generated?

Mathematica is a bit unusual as a programming language because it never stops on messages, regardless of whether the message is an error, a warning or just an informative message. It simply prints the ...
397 views

### How to apply restrictions to the “integrated” variable, when using NDSolve?

I have to integrate an energy along a path. I know the energy at the "beginning" of the path (energy[0]), and I can determine the energy change (gain and loss) ...
219 views

188 views

### Export a Row or Column as an image

How could I export the following as a single image and set its dimensions ? ...
2k views

### Is there a syntax for single-line comments for notebooks?

I'm aware that I can use (* ... *) to comment out stuff in a notebook. Many languages have a syntax for single-line comments, such as ...
373 views

### How can I speed up image importing? [closed]

The following examples show how slow it is to load a simple GIF. Can anything be done to make it faster? System #1: Mathematica 8.0.1.0, HP notebook, Win7 64Bit, 2 x 2.4Ghz Intel Core i5, 2GB RAM, w/ ...
583 views

### How to determine how much of a table is generated?

If I'm generating a table from a slow function, like this: foo = Table[SuperSlowExpression, {1000}] is there a way to determine after submission (so it is too ...
559 views

I know that this has been discussed here (How do I clear all user defined symbols?), but my case is somewhat different. How does one unload packages during runtime that were loaded with the start of ...
228 views

### How to fix the orientation and scaling of Graphics3D?

To visualize an eigenvector and value calculation I tried to display the eigenvectors (scaled by the eigenvalues) as arrows in a Graphics3D plot using Manipulate. The (symmetric) matrix is a function ...
402 views

### Implementing a safe ValueQ that does not evaluate its argument

Mathematica has a built-in function ValueQ. Quoting the docs, ValueQ[expr] gives True if ...
2k views

### How do I draw a triangle given the lengths of the sides?

I know, of course, how to draw a triangle in the plane given the vertices: Graphics[Polygon[{{1, 0}, {0, Sqrt[3]}, {-1, 0}}]] But I'm not sure how to simply draw ...
152 views

### What is the quickest way to convert a lot of SQLDateTime[] objects to DateLists

I often run database queries that return sets of {date, datum} objects. A hypothetical query looks like ...
2k views

### How do you draw the plane on which two vectors lie?

Given two arbitrary vectors $\textbf{v}_1$ and $\textbf{v}_2$, how can I draw the plane which they span?
660 views

### Obtaining the square-root of a general positive definite matrix

I have a matrix which I know to be positive definite. The entries of the matrix might be complicated but they are all real. To find an expression for the square root of this matrix (i.e., ...
370 views

### How to set focus of a dialog window?

I have a dialog, which, when pops up, requests input from the user. How can I set the window up that the focus is on the InputField of the new window (i.e. the ...
253 views

### Stealth daylight saving shift in SQL data

I'm querying a SQL database with DatabaseLink and resulting SQLDateTime objects are shifted by an hour during daylight saving ...
219 views

Is there a possibility to suppress the Mathematica Kernel taskbar tab when accessing it through .NETLink on Windows?
1k views

### Syntax highlighting for your own functions

Mathematica has a useful feature that for functions and special constructs getting passed local variables (for example Minimize or ...
250 views

### Why does JLink lock unopened jar-files in Windows

Since the introduction of JLink (maybe a bit later) it is possible to put jar libraries inside the directory-structure of packages. If this package is installed in ...
488 views

### Probability problem — Rube Goldberg solution?

A user posted this question on StackOverflow which was closed as off topic: 3 people are playing a game with a standard 52 card deck. Each player is given 2 cards each, possible cards and their ...
395 views

### Threading a compiled function over multiple arguments of different lengths

I am interested in threading a compiled function over multiple argument lists of different lengths. I will explain this in two steps: Suppose f is some function. Then one can define another ...
229 views

### What is this character: [esc][comma][esc]?

What is the character obtained with they key sequence Esc,Esc called? On my front end it is not displayed, but there's something there messing up my input. It's a bit annoying when I'm after a $\mu$ ...
2k views

### Is it possible to prerender animation in Wolfram Mathematica?

I have a DensityPlot which is evaluated for a long time. I wish to use it with animation, but it is absolutely inapropriate. Is it possible to render animation ...
406 views

### Show path with arrows in a matrix

I have a matrix, for example, 5x5 matrix Partition[Range[25], 5]. And I am given a list, for example: ...
435 views

### How are MemberQ and FreeQ so fast?

I would like to understand the implementation that allows MemberQ and FreeQ to be as fast as they are. I noticed this thanks to ...
345 views

### Is Compress[] compatible between different Mathematica versions?

Compress[] was introduced in version 6 of Mathematica. It gives a compressed version of expressions represented as a string of ASCII characters. It preserves more ...
1k views

### Plotting several functions

I'd like to plot a function of one real and one integer variable, but I don't want them all shown in the same 2-D plot - I'd like to see them as separate curves so I can see both 'axes', more like ...
245 views

### Reading from a text file and store the results back into it

I am totally new to mathematica but started learning how to use it. I use the following function to convert a decimal number into its binary representation. ...