14
votes
1answer
353 views

What is the real default CellEvaluationFunction?

The default CellEvaluationFunction is Identity but one can quickly see that this is handled specially as an equivalent function, ...
4
votes
2answers
186 views

How to fold output cells by default?

In Mathematica the default behavior of output cells is to pop up after the kernel has processed the input cells and got a result. I know I could add ; in the end of ...
1
vote
3answers
199 views

Defining a polygon by clicking on an image [duplicate]

Imagine I have some image, $I$, and I'd like to define a polygon by sequentially clicking on the image to define vertices $(v_1, ...) \in V$, where vertices $v_i$ and $v_j$ share an edge if $j = ...
10
votes
1answer
146 views

Functions returns Command Completion Output

Is there a function that returns the output as if you invoked Command Completion. To help clarify I am looking for a function that returns the Cell Data as if you invoked ...
1
vote
0answers
31 views

Symbol created in unevaluated second argument of If [duplicate]

Apologies for the long question title, but I couldn't come up with something shorter to describe the following. Starting with a clean session, there are no symbols in, let's say, ...
3
votes
3answers
277 views

Temporarily redirect the output of Print[ ] to a second file

I have started using Mathematica to automate file backup operations. The logistics I need make Mathematica a good choice. I am testing and developing the Notebook manually, and ...
2
votes
1answer
108 views

Can I apply a ColorFunction to FaceGrids, or otherwise have FaceGrids with varying color?

I want to make a 3d plot with FaceGrids with a certain color scheme. Specifically, I'd like them to be one color below a diagonal line, and a different color above ...
1
vote
1answer
264 views

Initialization Cells in CDF

I am wanting to run about 15 pages of initialization cells in a CDF, but can't seem to do so. I have set the InitializationCellEvaluation to True and InitializationCellWarning to False, but it doesn't ...
2
votes
0answers
48 views

How to ensure that command line variables are secure for MathKernel scripts?

Suppose I write a Mathematica script, called test.m, like the following: Print["Hello, World!"]; test = ToExpression[$CommandLine[[-1]]]; Print["I'm alive!"]; ...
1
vote
2answers
201 views

URLFetch functionality for a Persian website

I want to fetch the content of a Persian website. I tried URLFetch["http://www.tsetmc.com/"] Why is Mathematica unable to recode the characters in the results ...
0
votes
1answer
560 views

PDF of binomial distribution and mixed binomial distribution

I want to plot the PDF of binomial distributed function and a mixed binomial distributed function, therefore I entered for the binomial distribution function the following: ...
8
votes
1answer
496 views

Problems with “Test Connectivity” and the Pacletserver

I know there has been a similar questions to this already but the solution did not work for me so here again: I have internet connection and I can execute such commands like: ...
1
vote
2answers
307 views

Placing a zero at coordinate center when plotting with Ticks -> None

I'd like to plot a certain function where only its qualitative progession shall be emphasized. Thus, using the Ticks->None option seems to be appropriate. ...
1
vote
1answer
70 views

How can I get a horizontally centered input window?

This example displays a input window at a position of 675 from the left. ...
10
votes
4answers
230 views

Is it possible to separately call the default value of a variable which isn't at the end of the sequence?

After reading this post I recalled an old question I once met. We know that we can set default values for variables of a function: ...
21
votes
2answers
659 views

Is there any way to define pure functions with optional arguments?

For example consider the following function: Function[{u,v},u^2+v^4] Is there anyway to define default values for the variables ...
-4
votes
1answer
2k views

Determine the 2D-Fourier transform of an Image

I am new to Mathematica and using Version 8.0. I want to calculate the 2D-Fourier Transform of a digital image and see its Magnitude and Phase Spectrum, and reconstruct it.
2
votes
2answers
155 views

Compile error from If but not from Piecewise

Consider this: point={1.,2.}; f1 = Compile[{{t, _Real}}, Evaluate[Block[{a, b}, {a, b} = point; If[t > 0., a*b*Sin[t], 0.]]]]; f1[2.] ...
1
vote
1answer
172 views

How can I eliminate $x_1$ from my two ODEs?

How can I get Mathematica to eliminate $x_1$ in the equations in the first box to achieve the equation in the second box? My code: ...
2
votes
1answer
738 views

DSolve doesn't find a solution

I have this partial differential equation (G and M are constants): and a solution is: Mathematica doesn't find any solutions. My code for DSolve is: ...
7
votes
2answers
277 views

Adding a constant vector to a vector differential equation seems to break NDSolve. Why?

I'm trying to solve a differential equation that's phrased in terms of matrices and vectors. My minimum working example is this: ...
2
votes
3answers
1k views

How to color a contour plot over a subset of colors displayed in the bar legend

This seems real easy but I can't find the answer. I have a few contour plots that I am combining and want to use only one bar legend that captures all the values. Given that I know the range of ...
4
votes
2answers
237 views

Filling a plotted line both below and above the line

I'm relatively new to Mathematica. I tried looking for a solution online but couldn't find anything. I want to fill a plotted line both above the line (one color) and below (another color). For ...
2
votes
1answer
72 views

How to toggle visibility of all the evaluatable cells (but not their output)?

I know that I can select individual evaluatable cells and disable their Open property (through Cell > Cell Properties), but ...
3
votes
2answers
192 views

Implementation of a recurrence relation for the polynomials appearing in the large order asymptotics of the Bessel functions

I would like to implement the recurrence relation for the polynomials $U_n(x)$ appearing in the large order asymptotics of the Bessel functions. The recurrence in question is ...
9
votes
1answer
209 views

How secure is J/Link?

Are there security concerns with using J/Link? If so, is there any way to encrypt the data passed between Mathematica and Java? If Mathematica and the JVM are running on the same machine, is there any ...
5
votes
1answer
119 views

ArrayPlot: space between displayed data and frame

When I execute the lines ...
9
votes
1answer
230 views

Pure function with attributes of arbitrary number of arguments: Is it possible?

Mathematica allows to define pure function, like Function[{a, b},Length[Unevaluated@a]{b}][1+2,2+3] (* ==> {0} *) Pure functions in Mathematica can take an ...
15
votes
3answers
306 views

How to make Joined skip missing data points

I have a set of data taken on sequential days, but some points are missing. I'd like to make a joined date list plot, where the points are not joined across the missing point.The following example ...
1
vote
1answer
128 views

Simple rule appears not to work

I have the following simple code ...
4
votes
2answers
195 views

Correlation with missing data

I have two lists, age and score, that I want to find correlation on for 50 people. For some people, the score is blank. Example data: ...
3
votes
1answer
329 views

Using Thread or MapThread over multi-level, ragged lists [duplicate]

This may be a rather strange question. I will try to create a sort of minimal working example. Suppose that I have two lists, list1 and ...
9
votes
2answers
187 views

Why does Sort fail in this simple example?

I'm sure I'll be embarrassed by the answer, but I don't understand why I get the following result: list = {{9, "b"}, {4, "a"}, {7, "k4"}, {6, "k3"}, {5, "w"}} ...
1
vote
1answer
175 views
3
votes
1answer
185 views

Depth from Graphics3D

Consider this simple 3D rendering with some geometric primitives: ...
7
votes
2answers
295 views

Why LibraryLink function crashes at a second time?

I'm trying link one of Lapack's function to Mathematica through LibraryLink, and the Library function works great at the first execution but crashes at the second time. Here is the code (modified ...
3
votes
1answer
98 views

PrincipalValue option of Convolve not working in 9.0.1?

The PrincipalValue option of Convolve is used in this question to define the Hilbert transform. However, in Mathematica 9.0.1, ...
13
votes
4answers
459 views

Button evaluation inside DynamicModule

Someone know why this Button works when clicked: ...
2
votes
0answers
104 views

“LinkOpen::linke : specified file is not a mathlink executable”

The following code runs fine if I run it interactively: ...
7
votes
4answers
188 views

Strange behaviour when line-wrapping text in a Pane

I noticed some strange behaviour of Pane. In the result from the following code, the line wrapping is not consistent: why do the first and last line contain four ...
12
votes
2answers
290 views

Why do NumberForm and Round apparently use different tie-breaking methods?

When rounding numbers (for example, rounding a real number to the nearest integer), the "round to nearest" rule is usually used. For example, 1.4 is rounded down to 1 and 1.6 is rounded up to 2. ...
9
votes
1answer
1k views

How do I flatten transparency on a graphics, for conversion to eps or similar?

I've got a graphic that I'd like to save as an eps file. Trouble is, the graphic has some transparency to it. Since the eps format doesn't handle transparency, I want to flatten the transparency out, ...
1
vote
0answers
693 views

How to Output Chi-Squared Statistics when using NonLinearModelFit

I am using NonLinearModelFit for some curve fitting and I was wondering if NLM is able to output chi-squared/leastsquared statistics from the best-fit parameters and confidence intervals. From my ...
5
votes
2answers
139 views

How to resolve a Unix symlink?

Does Mathematica have any function to resolve a Unix symlink (recursively, if necessary) to its real path?
1
vote
1answer
67 views

List-manipulation Interpolation

For example, I have the following list: AA={{0, 20000.}, {26.6, 19950.}, {53.2, 19950.}, {79.8, 19950.}, {97.1198, 18644.1}, {102.681, 16452.3}} Another ...
4
votes
2answers
135 views

Equivalent of __FILE__?

Many languages define a special identifier whose value is the path to the source file currently being processed. (For example, in C, this is done through the ...
0
votes
1answer
115 views

Question with ParametricNDSolveValue

When solving the following system: ...
2
votes
0answers
65 views

How to create a ListPlot containing two lists? [duplicate]

I'm trying to plot a set of points where one list corresponds to the X values another list corresponds to the Y values. I have ...
5
votes
2answers
255 views

Building conditional lists with Manipulate

I'm trying to select elements of a list that satisfy some criteria using Manipulate[]. Given 2 lists: ...
1
vote
1answer
115 views

Exporting a histogram to PDF in without rasterising it

How can I export a histogram without rasterising it? The labels and axes seem unaffected, but the bars themselves are pixelated when I zoom into them in a PDF viewer. For example, if I run ...

15 30 50 per page