All Questions

2
votes
1answer
190 views

How to set different labelstyles for controls in manipulate?

Background: Manipulate[ {jj, kk}, {{jj, 2, "Select j"}, 1, 11}, {{kk, 2, "Select k"}, 1, 11}, LabelStyle -> {Bold, Medium} ] In the example above ...
17
votes
2answers
4k views

Can Reduce *really* not solve for x here?

Sometimes I get the feeling I'm just flailing blindly with Mathematica. Is solving for $x$ in the equation $$ \frac{\cosh (x/2)}{x} = \sqrt{2} $$ really beyond the scope of Mathematica? I try to ...
4
votes
2answers
2k views

Plot CSV-data; make statistical statements in Mathematica / WA

First, I'm quite new to Mathematica so sorry in advance if some questions seem to be trivial. I have a CSV-file which looks like this: ...
7
votes
3answers
212 views

Generating date ranges

How can I, in one line, generate all the dates with a constant day difference from one date to another? For example, if I'm interested in dates in the interval staring from 24.4.2012 till 2015 and a ...
11
votes
1answer
234 views

Rounding problems inside InputField

Consider the following InputField InputField[Dynamic[h2, If[# === Null, h2 = h2, h2 = Round[#, 0.001]] &], Number] The ...
2
votes
1answer
166 views

How to set PageWidth when using PutAppend to append expressions to a file?

Do[ PutAppend[Table[i, {RandomInteger[100]}], "./file.m"], {i, 100} ] I'd like each inner list to always appear on the same line, but not automatically ...
7
votes
3answers
4k views

Is there a simple way to plot complex numbers satisfying a given criteria

I think this should be straightforward, but I cannot seem to find a good source on how to do it after searching around, so I'm trying to sketch sets of complex numbers that meet a given for criteria. ...
14
votes
3answers
2k views

Solving a Volterra integral equation numerically

I would like to solve for $P(t)$, in Mathematica, a Volterra integral equation of the 2nd kind. It is: $$P(t) = R_0(t) + \int_0^t P(t') R_0(t-t')dt'$$ I know the function $R_0$ and would ...
7
votes
1answer
279 views

Assignment rule to distribute matrix-multiplication over custom notation

I'm trying to write some code to do basic algebraic manipulations in BraKet notation. Thus far I have a function KetToVec which will convert any expression of the form a1 Ket[s1]+ b Ket[s2] +... to a ...
3
votes
1answer
109 views

Safely generating multiple controls from a list of variables

Suppose I need to create sliders associated with variables from a given list: ...
11
votes
3answers
257 views

Numbers in alternate bases transcend the evaluator?

It looks to me like a number in a base other than base 10 gets evaluated before the evaluator ever gets a chance to be tweaked. For example, FullForm[16^^abcdef] ...
10
votes
3answers
427 views

Mathematica as a report generator

I would like to use Mathematica as a kind of report generator. I'm working in a Mathematica notebook and I want to handle Mathematica like this: 1) I want to define one cell as a text cell. In this ...
5
votes
2answers
464 views

Developing domain specific languages and computational knowledge engines using Mathematica

In one of Leonid Shifrin's excellent summaries, he mentioned that MMA capabilities include developing Domain Specific Languages (DSL). I'd like to develop a Health care IT application that can ...
12
votes
3answers
437 views

Using Memoization with a Mutable Object

In looking for a solution to this question, I ran across some old binary tree code by Daniel Lichtblau, reproduced below: ...
6
votes
2answers
656 views

Why does Expand not work within a function?

I'm writing this fairly simple function: ...
26
votes
5answers
7k views

How to use Mathematica functions in Python programs?

I'd like to know how can I call Mathematica functions from Python. I appreciate a example, for example, using the Mathematica function Prime. I had search about MathLink but how to use it in Python ...
13
votes
2answers
504 views

How to monitor the progress of Read?

I use f = OpenRead["largefile.m"] x = Read[f]; Close[f]; to read in a Mathematica expression from a large file largefile.m ...
8
votes
2answers
423 views

TeX and TraditionalForm

I have a little problem, and hope, with your help, I'll be able to solve it. As you got from the title, I have some trouble with TeX in Mathematica. Imagine, I want to output a nice DisplayFormula, ...
25
votes
4answers
1k views

How to create strong types?

In a program I'm writing, I create a list of lists, that looks something like this: {{100, {1,2,3,4,5}}, {105, {2,4,6,8}}, {42, {42,39,56}}} I then pass this ...
0
votes
1answer
394 views

How to solve a problem in relative motion?

I have a project due tomorrow that I have been struggling with for a month. I am utterly stumped, any help would be appreciated. The problem is: There is a ferris wheel, 30m in radius, set 80m ...
4
votes
2answers
768 views

Exporting a CDF to HTML

I'm using Mathematica for Students on a Mac. How do I export a CDF document to HTML? According to the Wolfram website I should click on ...
6
votes
1answer
406 views

ReplaceAll inside an Iterator

I'd like to apply a set of rules to an expression defining the iterators of the table, like this: ...
11
votes
1answer
263 views

Finding minimal region with padding and linear map to circle

Suppose I have n ordered points. I would like to find a simple region that contains all the points and is close to the smallest region that contains the points except it is smooth and has some ...
3
votes
2answers
204 views

How to use ForAll in Reduce

I was wondering: how does one use the ForAll function in Reduce? In particular, I am looking for the set $\{w\in \mathbb{R}^2 | ...
6
votes
3answers
1k views

Save and call matrices with large output in Mathematica [duplicate]

If we have the large matrix A=RandomReal[{-10, 10}, {1000, 1000}]; and I need it for further calculation, how can I save it on hard disk and then call for ...
5
votes
1answer
220 views

Why does the Front End group backslashes into pairs?

What is \\ for? Help finds nothing on it. An odd number of backslashes greater than one are grouped by two and the last one is displayed with a different color. ...
16
votes
2answers
1k views

Detecting spikes by shrinking WaveletPacket basis using a specific threshold

Last time, I asked how I can use the command DiscreteWaveletPacketTransform[data, filter, 0] for spike detection and I got answers mostly based on an automatically ...
12
votes
1answer
251 views

What's a good style for inheriting Options[] of built-in function?

Options[myPlot] = Options[Plot]; myPlot[args___] := ... When defining a "wrapper" function like the above, I'd like it to inherit the ...
11
votes
2answers
3k views

How to print without having newline added automatically at the end?

Print["first part of the result", DateString[]] Print["addition to the result", DateString[]] will add a newline character at the end of line automatically for ...
6
votes
2answers
1k views

How to invert an integral equation

There have been numerous times when I've needed to invert an integral equation, i.e. I have something like $$f(x) = g_1(x)\int_{0}^x g_2(x') dx'$$ for arbitrary functions $g_1$ and $g_2$, and ...
17
votes
2answers
2k views

Open Excel file with Mathematica

I would like to open an Excel file and manipulate it as a COM object. While I'm able to open an instance of excel with ...
10
votes
1answer
161 views

Figuring out how AbsoluteOptions works with Graphs

I am puzzled by how AbsoluteOptions works with Graph objects. I would have expected that one could use it to obtain all the ...
1
vote
3answers
2k views

Mathematica slope fields

I would like to make a slope field. Here is the code ...
14
votes
5answers
822 views

Changing the order of elements in a chart legend

In a stacked BarChart or Histogram the bars are stacked from bottom to top, while the legend entries are listed from top to ...
12
votes
2answers
526 views

Surprises simplifying simple polynomials

I came across some somewhat surprising behavior of Simplify today, on something very simple. Let's take two cubic polynomials that we know have the same value: ...
15
votes
2answers
614 views

Command Completion

Note: As of version 9, this functionality is available and works out of the box. I've a few questions about Command Completion in Mathematica. I recently discovered this feature, and it's really ...
3
votes
2answers
765 views

Mathematica output format for big numbers

I need to write output of a Mathematica expression (a list of equations) in a file. I use ...
19
votes
3answers
439 views

Is there a faster way to create a matrix of indices from ragged data?

I have data that is given as a list of ordered pairs mixed with scalars. The pairs can contain infinite bounds. My goal is to convert the data into an index used in future computations. ...
11
votes
2answers
650 views

How to plot a barycentric line

I want to plot a barycentric function on an equilateral triangle (ternary plot). For example f1 = {Abs[Sin[x]], Mod[x, 2], Abs[Cos[x]]}; At the moment I evaluate ...
13
votes
3answers
863 views

How to scrape the headlines from New York Times and Wall Street Journal?

How to scrape headlines from New York Times, Wall Street Journal main pages to create datasets similar to this service? Importing HTML from nyt.com (HTML4) results in a ...
4
votes
1answer
78 views

Trouble using FindInstance with MatrixRank

I'm really confused about what's going wrong with my call to FindInstance: ...
17
votes
9answers
1k views

Determining the week of a year from a given date

Consider the following: AbsoluteTime["17/04/2012",{"Day","/","Month","Year"}]; From my calendar in my office, I know that April 17th is in the 16th week of the ...
4
votes
1answer
90 views

How to take several values out of a large expression?

Background: Consider the following graphics directive. ...
13
votes
4answers
456 views

How to recompute the layout of a Graph?

I asked a question about changing Graph properties in a similar way to how Show can change ...
6
votes
1answer
1k views

Rotating 3DPlot into animated gif

I'm trying to make an animated gif of a 3D plot by rotating the plot in its middle, around a vertical axis. I used the tricks gave by F'x and Heike in this thread autorotating 3D plot but I ...
7
votes
2answers
203 views

Graph does not accept Property Options

My question is concerned with the Graph functionality, which was newly implemented in Mathematica 8. I already used GraphPlot ...
4
votes
1answer
166 views

Create string from character code

Is it possible to convert a charcode/keycode to a string? I want to do this to create variables in a generated equation.
5
votes
1answer
1k views

ListContourPlot-ColorFunction

How can I use ONLY the central 90% of the spectrum, not the whole range? For example, I do not like to see the lowest values in purple, but in deep blue color. ...
5
votes
2answers
302 views

Create self-contained plots when Ticks or FrameTicks require external functions

Let's say I define tick marks for a plot in a separate function outside of the plot: ...
5
votes
1answer
169 views

Stopping Agglomerative clustering under a condition in Mathematica

How do I instruct Agglomerative clustering to stop/NOT merging two particular clusters if the distance between the two clusters is larger than a threshold value? I know that we can implement a custom ...

15 30 50 per page