All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
481 views

Export long filename truncated

I am seeing a weird behavior on exporting at least one type of file (here, a QuickTime movie) to files with long names. If I do this: ...
F'x's user avatar
  • 10.7k
7 votes
3 answers
844 views

How to create a list of pre-defined functions?

I would like to create a list of Cauchy distribution pdf's, having different locations of their maxima, and being multiplied by different factors; then I'd like to calculate those functions' values ...
canavanin's user avatar
  • 173
7 votes
4 answers
1k views

Stationarity tests

I have the Time Series package and Mathematica 8. In the package, there is the function 'StationaryQ' to test the stationarity of a known model. Is there any function in Mathematica to test the ...
Emanuele's user avatar
  • 173
16 votes
4 answers
2k views

Printing exported PDF graphics fails (version 8)

When I export even simple graphics, say, a DateListPlot to PDF under Windows, it refuses to print on any of the printers at work. Acrobat (Reader X) throws three ...
Verbeia's user avatar
  • 34k
9 votes
1 answer
214 views

Accept Infinity as an Integer argument

I have the following function, albeit contrived: Foo[x_Integer] := Module[{i}, i = 1; While[i <= x && i <= 10, i++]; i - 1 ]; I am ...
mmorris's user avatar
  • 1,162
42 votes
2 answers
2k views

My donut has holes in it!

More than one hole, I mean… I’m trying to export from Mathematica into the X3D format, with the longer term goal of generating 3D figures for PDF inclusion. But I'm stuck at the first step: ...
F'x's user avatar
  • 10.7k
12 votes
1 answer
918 views

Mathematica implementation of Earth Movers Distance?

Has anyone implemented in Mathematica the Earth Mover's Distance (EMD)? A concept dating back to Monge 1871, used to compare histograms and images, e.g., the CIEDE2000 Color Difference algorithm. ...
alancalvitti's user avatar
10 votes
2 answers
515 views

Cases[data,Colon[key,_]] vs. Cases[data,key:_] toward XPath, XQuery

Exploring methods to index and search tree-structured key:value pairs via named-entity index (key paths) as opposed to Position-based indexing. Using Rule as ...
alancalvitti's user avatar
20 votes
2 answers
857 views

Using several anonymous functions mixed together

This works: list // BarChart[#[[2]], ChartLabels -> DateString @@@ #[[1]], ChartStyle -> "Pastel"] & This doesn't: ...
C. E.'s user avatar
  • 69.5k
22 votes
4 answers
762 views

Getting lengths of sublists that sum to more than one

I have a long list of numbers, and I'm interested in finding the length of each sublist that totals to more than 1, so for the list ...
Pillsy's user avatar
  • 18k
13 votes
3 answers
861 views

Exporting and reimporting a list of lists changes the dimensions

Could anyone explain to me what in the world is going on here and please help me in reading in dummy.dat properly? ...
Name's user avatar
  • 477
39 votes
5 answers
22k views

Plotting Error Bars on a Log Scale

I have a plot with ErrorListPlot ...
s0rce's user avatar
  • 9,532
9 votes
2 answers
607 views

How can one nested list be used to find the positions of those values in another nested list?

...
Nothingtoseehere's user avatar
12 votes
2 answers
2k views

Stream CSV or TSV files

RAM limitations make import impractical for large CSV files. Is it possible to Stream CSV correctly? str = OpenRead["EU.csv"]; Read[str, "CSV"] Read::readn: ...
Mr. Demetrius Michael's user avatar
53 votes
6 answers
11k views

Finding real roots of negative numbers (for example, $\sqrt[3]{-8}$)

Say I want to quickly calculate $\sqrt[3]{-8}$, to which the most obvious solution is $-2$. When I input $\sqrt[3]{-8}$ or Power[-8, 3^-1], Mathematica gives the ...
jtbandes's user avatar
  • 1,412
3 votes
2 answers
340 views

Rotate doesn't work with BarChart and BoxWhiskerChart

Rotate@BarChart[RandomReal[1, {4, 5}], ChartLayout -> "Percentile"] Even though the FullForm generated by BarChart is Graphics expression, Rotate has no ...
alancalvitti's user avatar
26 votes
6 answers
7k views

Fixing quirky typesetting in plot labels

Consider this example plot. Plot[ 1-Exp[-x], {x,0,3}, AxesLabel->{"thickness (μm)","power density (W/m^2)"} ] Let us hold the typographical quality of the ...
ArgentoSapiens's user avatar
7 votes
1 answer
1k views

How do I calculate the probability of reaching mean residual life

I need to understand the Survival Analysis concept of "mean residual life (MRL)" and calculating probabilities for reaching it. From another discussion: The MRL at time t is the mean additional ...
Jagra's user avatar
  • 14.2k
16 votes
3 answers
9k views

Assigning values to a list of variable names

As part of a calculation I need to do something like this Evaluate[{aaa, bbb, ccc}[[ index]]] = {1, 2, 3, 4, 5} so if index is ...
BlueMac's user avatar
  • 711
5 votes
2 answers
1k views

Plotting contours of a function for different values of a parameter

I want to draw a picture of $(x-t)^2 + (y-t^2)^2 - t^2$ in $xy$ plane, with different values of $t$. I did it in a very silly way , namely, ...
Vladimir's user avatar
  • 185
45 votes
6 answers
3k views

How to visualize/edit a big matrix as a table?

Is it possible to visualize/edit a big matrix as a table ? I often end up exporting/copying big tables to Excel for seeing them, but I would prefer to stay in Mathematica and have a similar view as in ...
faysou's user avatar
  • 10.9k
7 votes
4 answers
2k views

Delayed evaluation of assignment

I have a set of PDE's that depend on parameters. They depend on many parameters, but for simplicity we can here assume that they depend only on one, say a. I want ...
yohbs's user avatar
  • 7,046
43 votes
7 answers
8k views

How to apply or map a list of functions to a list of data?

Say I have a group of functions: f1[a_] := a * -1; f2[a_] := a * 100; f3[a_] := a / 10.0; and some data in a list: ...
cormullion's user avatar
  • 24.2k
19 votes
5 answers
4k views

Numerical underflow for a scaled error function

I calculate a scaled error function defined as f[x_] := Erfc[x]*Exp[x^2] but it can not calculate f[30000.]. ...
こじま's user avatar
  • 193
4 votes
3 answers
3k views

Integrating with multiple indicator functions

I am trying to calculate an integral involving multiple indicator functions, such as: $$ h(u,v,w) = -\int_0^1 J^{\prime\prime}(s) (I_{(0,s]}(u) - s)(I_{(0,s]}(v) - s)(I_{(0,s]}(w) - s)\, dF^{-1}(s)$$...
Wayan's user avatar
  • 141
6 votes
1 answer
315 views

Getting Integrate to perform numerical integration

I am trying to calculate the mutual impedance of two antennas which is just a big integral. I defined my function in terms of my variable, but when I execute it, Mathematica runs for a while and then ...
Dmitry's user avatar
  • 63
15 votes
1 answer
2k views

Finding a Specific Line in a Package

In a package I am developing, I accidentally left this line Protect[ uncompleted prior to running the package. Mathematica produced this error message ...
rcollyer's user avatar
  • 33.7k
37 votes
7 answers
8k views

Importing a large Excel file

I'm trying to import a simple Excel file containing 94,000 rows and 52 columns of various types, mostly Reals. It's a 38-MB file. I get this super helpful error ...
ArgentoSapiens's user avatar
56 votes
5 answers
11k views

How can I extract data points from a black and white image?

Consider the following graph (source): Is there any way to extract the data points from this image in a semi-automatic way? I have seen, and tried the methods suggested in this question, but they did ...
Eli Lansey's user avatar
  • 7,419
60 votes
4 answers
10k views

Can I simplify an expression into form which uses my own definitions?

This seems like a simple thing to do, but I couldn't find anything relevant from Mathematica documentation. So suppose I have an expression: a*b/(a + a*Cos[a/b]) ...
Echows's user avatar
  • 971
7 votes
1 answer
443 views

Setting $RecursionLimit across all parallel kernels

I'm trying to optimize an elliptic curve factoring method by running it in parallel. There is a recursive step which required me to set the recursion limit higher than 256, however when I try and run ...
Jackson Walters's user avatar
10 votes
1 answer
279 views

Difficulty catching thrown errors in asynchronous tasks

In this Question, Leonid explained that module variables can get garbage collected from a chain of asynchronous tasks unless their Temporary attribute is cleared ...
Reb.Cabin's user avatar
  • 8,641
14 votes
2 answers
563 views

Split a Unicode string maintaining uppercase characters

I want to split a string according to a predefined set of substrings (lowercase), though the actual text can contain uppercase characters anyplace. The task is to find the matches, longer preferred ...
István Zachar's user avatar
20 votes
3 answers
8k views

Derivative of real functions including Re and Im

When deriving functions using Re, Im or Arg (and probably some other functions as well), ...
celtschk's user avatar
  • 19k
8 votes
1 answer
339 views

Module variable scoping in Scheduled Tasks?

I ran across a scoping puzzle while experimenting with ScheduledTasks, and I'd be grateful for an explanation from the sages here. I found a workaround by intuitive horse sense, but was unable to ...
Reb.Cabin's user avatar
  • 8,641
16 votes
1 answer
922 views

Is it possible to colorize brackets in the notebook editor to see matches more easily?

I've seen that if I click on a square bracket [, I can then use "Check Balance" in the right click menu to see where the matching bracket is. Is there a way to see ...
Peeter Joot's user avatar
  • 6,288
14 votes
3 answers
2k views

How to evaluate the $0/0$ type limit in Mathematica?

When I use Limit to evaluate the limit $$\begin{align}\lim_{k \to 0} \frac{ (k+2)(\alpha^2 - \sqrt{\alpha^4 + k}) + k}{\alpha^2 - \sqrt{\alpha^4 + k} + 2 k}\end{...
mschen's user avatar
  • 141
9 votes
3 answers
440 views

Can this code be written in a more functional style

Referencing this question, I wonder if the following code can be written more concisely using a functional style, i.e. without For loops or ...
Verbeia's user avatar
  • 34k
12 votes
6 answers
11k views

Notation of partial derivative

I want to write partial derivatives of functions with many arguments. Why is it that when I type f[x,y] ctrl+6 (0,1) it turns out to be bad syntax? The output of ...
yohbs's user avatar
  • 7,046
11 votes
2 answers
1k views

Handling vector comparisons in "Piecewise" function

Is it possible for the Piecewise function to process a vector comparison? For example, my input vector is x={0,1,2,3,4} I would like to define a function that ...
David L's user avatar
  • 163
4 votes
4 answers
2k views

recursively solve equation and saving the values

I am new to Mathematica. I am trying to recursively solve an equation and saving the values into a Table. Since I need the real solutions only I use ...
Wayan's user avatar
  • 141
17 votes
4 answers
1k views

How to determine the convex hull of some text?

How can I get the co-ordinates of the convex hull of a piece of Text?
Emre's user avatar
  • 1,700
9 votes
1 answer
729 views

Way to find color at a point in a Graphics?

I need to figure out a way to find out the RGB color value at a certain coordinate in a Graphics object. The Graphics object I am dealing with is continually Dynamically updated, so it is made of ...
Chirese's user avatar
  • 185
7 votes
1 answer
754 views

Color linear interpolation of ParametricPlot3D

I am looking for any ideas about how to colorize an ellipsoid with a custom gradient style or by a Blend function. I would like to colorize ellipsoid as follows: ...
Tomasz's user avatar
  • 73
8 votes
1 answer
260 views

How do I re-direct FilePrint's output?

I recently wanted to use FilePrint to print the contents somewhere else but in the notebook I was using. However, the obvious-seeming solution doesn't work at all: ...
Pillsy's user avatar
  • 18k
3 votes
0 answers
127 views

How do I direct output to a specific notebook or cell? [duplicate]

Possible Duplicate: How to pipe a stream to another notebook? Is there any way to create a stream so that all output to the stream (from Write or something ...
Pillsy's user avatar
  • 18k
34 votes
1 answer
7k views

Autorotating 3D plots

These days, I have to produce quite a few 3D surface plots (mostly functions of the type $\rho(\theta,\phi)$ plotted with SphericalPlot3D). To exchange these ...
F'x's user avatar
  • 10.7k
9 votes
2 answers
952 views

Function Interpolation with Automatic / Algorithmic Values Mesh

I have an underlying function f(x,y,z) that is computationally intensive, but is smooth and continuous. I'm needing to find the function values along a line in xyz. Currently, I'm calculating f at ...
Chris Roth's user avatar
5 votes
1 answer
127 views

Changes in Handling of Real Zeros

I recently upgraded from Mathematica 5 to Mathematica 8 and I have a number of notebooks that no longer work correctly. The problems relate to the use of units. I don't need complicated unit ...
Michael's user avatar
  • 53
22 votes
4 answers
18k views

How to change the axes' origin and direction?

I have manipulated an image and want to ListPlot it. However, the result is not to my liking because the conventions for drawing images and plots are different. ...
Emre's user avatar
  • 1,700

15 30 50 per page