All Questions

13
votes
5answers
2k views

Finding all elements within a certain range in a sorted list

Suppose we have a sorted list of values. Let's use list = Sort@RandomReal[1, 1000000]; for this example. I need a fast function ...
21
votes
2answers
1k views

How to manipulate web pages on Mathematica?

I wanted to input some data on this page through Mathematica: http://www.fundamentus.com.br/buscaavancada.php Then I would press the "buscar" button also through mathematica coding and get the ...
6
votes
2answers
2k views

How can I get Mathematica to solve an equation with multiple variables?

How can I get mathematica to solve the non-homogeneous differential equation with undetermined coefficients listed below? Solve $\ y''(t)+3y'(t) = 2t^4 $, using: $\ y_p(t) = ...
8
votes
2answers
440 views

Opening new notebooks with a non-default window size

I'd like to set Mathematica (8.0.4.0) up so it opens new notebooks with the "NaturalColor" stylesheet and with a window size like {800,770}. I tried to change ...
3
votes
2answers
689 views

Compute integral symbolically or numerically

I want to compute the integral of the following integrand ...
6
votes
2answers
467 views

Very long Refine/Solve batch run - is my code broken, or just complicated?

So I'm trying to run some Mathematica code in batch mode from my university cluster. Specifically, I'm trying to find the equilibria of a system of ordinary differential equations. Inspired by the ...
10
votes
1answer
1k views

Reference request for neural network programming in Mathematica

I'm looking for a good reference/book on programming neural networks in mathematica. I've been working through Freeman's "Simulating Neural Networks with Mathematica," but it is from 1994 so is quite ...
37
votes
3answers
3k views

Metaprogramming in Mathematica

Being functional, and having no "quotation", i.e. essentially treating data and programs semantically same, Mathematica seems naturally capable of doing metaprogramming. But could anyone construct a ...
97
votes
3answers
12k views

How to create word clouds?

Word clouds are rather useless fancy and visually appealing plots, where words are plotted with different sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ...
4
votes
1answer
618 views

How to create a histogram of annual events, such as cherry blossom time

I have calculated blooming and ripening times for a specific variety of plant, based on actual temperature data from over 40 years. I would like to create two histograms on a single axis; one for ...
5
votes
2answers
1k views

Multiple panel figure from combination of plots - bad alignment

I am trying to combine 3 ListContourPlots to obtain a 3 in-row panel figure in Mathematica 7, to export in one single eps file. One of the plots has also its own ...
19
votes
4answers
2k views

Mathematica envelope for the bottom of a plot, a generic function

I have the following set-up: xaxis = Table[x, {x, 0, 10, 0.01}]; yaxis = Table [Sin[x] + Abs[RandomReal[{-1, 1}]], {x, 0, 10, 0.01}]; ListLinePlot[Transpose[{ xaxis, yaxis}]] My ...
8
votes
3answers
586 views

Inverting a function in a certain region

InverseFunction works well for globally invertible functions, like f = 2*# + 2 &; InverseFunction[f] ...
8
votes
1answer
802 views

How to apply a permutation to a symmetric square matrix?

Given a symmetric square matrix, how can I apply a permutation to the rows and columns (i.e. the same permutation to both the rows and the columns) such a way that the new structure of the matrix ...
3
votes
3answers
915 views

Changing variables algebraically

Suppose one has two functions, $y(x)$ and $z(x)$, and one seeks to obtain $y(z)$ by substituting $x(z)$ into $y(x)$. Can this be done in a single step? Or must $z(x)$ first be inverted independently? ...
17
votes
5answers
6k views

Problem with NonlinearModelFit

I'm having trouble with a non-linear fit: fit = NonlinearModelFit[data, y0 + A Sin[\[Pi] (x - xc)/w], {y0, xc, A, w}, x] where ...
7
votes
6answers
1k views

Simplifying nested If statements

Consider : list = {100,102,103,99,106,107,104,112} I want to consider, extract only the "big moves" of that time series. In this case the moves bigger then 5 ...
10
votes
3answers
320 views

Why does ++++x return an increment of 2 when the value of x is only incremented by 1?

This line returns 3: x = 1; ++++x However, the value of x after the increment is only ...
14
votes
3answers
591 views

Gridlines of a framed plot with a background cannot be white?

Looking at this question, I am reminded of a problem that I was never able to solve with obtaining a particular plot format. The issue is that GridLines sit behind ...
2
votes
1answer
1k views

Mathematica Can't Evaluate This?

I am trying to find the inverse function of $\frac{\ln{x}}{x^2}$ in Mathematica. I am using the Solve[] function to find the inverse (yes, I know about ...
4
votes
3answers
266 views

Brackets in output make unable to use output to identify matrix element

I'm trying to write a code where each matrix element swaps with a randomly selected neighbor (cardinal directions only) to redistribute the matrix. So far I've been able to replace an element with its ...
14
votes
4answers
2k views

Creating overlapping histogram plots

I am plotting two histograms on the same graph: g1 = Histogram[bc, ChartStyle -> {Red}] g2 = Histogram[bcx] Show[g1, g2, PlotRange -> {{0.1, 0.6}, All}] ...
4
votes
1answer
199 views

overriding the format of 'copy-as' latex?

In the answer to Bold face formatting for vectors instead of overarrows like latex \mathbf{}? was a nice method of specifying the visual display for a variable, so that I can do something like the ...
2
votes
1answer
249 views

AbsoluteTiming affected by surrounding code

In the process of simplifying code posted for another question, I noticed AbsoluteTiming returned different results for the same code being timed, ...
28
votes
1answer
834 views

Numerics with Mathematica

From time to time, I would like to use Mathematica purely numerically, e.g., plotting a function which is defined as an integral which cannot be solve analytically or a solution of a differential ...
24
votes
7answers
4k views

Changing the background color of a framed plot

I frequently generate framed plots like this: Plot[Sin[x], {x, 0, 2 \[Pi]}, Frame -> True] Is there an easy way to change the background color of the framed ...
4
votes
0answers
289 views

Increase precision of custom function

I hope the title is not misleading: Suppose I have a function that is quite complicated, e.g. f[u_] := Exp[-Exp[- Abs[c.u]^a] Sin[d.u] Sin[(Abs[c.u]^a) ... I ...
7
votes
4answers
1k views

Bold face formatting for vectors instead of overarrows like latex \mathbf{}?

OverVector can be used to make a symbol look like a vector in text sections of documents. I happen to like bold symbols for vectors better, as in latex ...
17
votes
2answers
2k views

Debugging Mathematica Code

In various integrated development environments, such as Microsoft Visual Studio, there is an integrated debugger where you can step through code sections, examine the state of variables and figure out ...
1
vote
2answers
2k views

How do you define the domain of a plot?

How do you define the domain of a plot? For instance, if I want to plot a standardized bivariate normal density function (with $r=0$), how do I specify the domain to be $[-3,3]$?
7
votes
3answers
224 views

How to turn a set of strings which represent a list into a 2D list

I have a set of data read in from a larger CSV file. I want it to match the format I have from another analysis. It is structured as a series of strings with letters and numbers Here it is copy-pasted ...
12
votes
3answers
445 views

Considerations when determining efficiency of Mathematica code

I have two segments of code that do the same thing and I want to determine the which is more efficient. What are the considerations when determining efficiency of Mathematica code? ...
4
votes
1answer
613 views

Definite and Indefinite integral give different results for piecewise function

I have the following function: $$ f(q,y)= \begin{cases} \tfrac{11720+p}{37791360} & -11720<p<-7720 \\ 0 & \text{True} \end{cases} $$ where $p = 443\ y-777600\ \sin^{-1}\left(\frac{q ...
1
vote
0answers
104 views

is there an equivalent of “show” steps? [duplicate]

Possible Duplicate: Get a “step by step” evaluation in Mathematica In wolfram alpha, when preforming for complicated integrals there's a 'show steps' option that explains how ...
0
votes
2answers
2k views

How do I clear all variables with subscripts? [duplicate]

Possible Duplicate: Clear complains that a variable is not a symbol or a string? Clear["Global*"]` Works for most variables, however if i do something ...
10
votes
2answers
1k 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 ...
40
votes
2answers
2k views

Mathematica Debuggability

One of the things that I really dislike about Mathematica is its lack of debuggability compared to many other programming languages. Some of the problems arises from the functional nature of ...
6
votes
1answer
822 views

Formatting output of OpenAppend[] to match what Export[data,file,“.csv”] would output?

I have a large data set that gets exported to a .csv file. Export[data,filename,"csv"] is extremely fast and formats the data in a nice JMP-friendly manner. ...
7
votes
3answers
493 views

Reading from a stream of strings and numbers delimited by commas

I am trying to read from a stream of strings and numbers delimited by commas similar to the way I have read from a stream of strings and numbers delimited by spaces. Example delimited by spaces ...
3
votes
1answer
240 views

Too much vertical space in a CDF file

When I prepare a CDF file to be included into a web page, far too much blank vertical space is left over the pane. Is there a command to reduce that? This is illustrated by the files SimpleDemos.nb ...
10
votes
3answers
236 views

Efficient way to turn a subset into a permutation

For an input vector $\{a_1,a_2,\ldots,a_n,b_{1},b_2,\ldots,b_{m}\}$ and a list of ordered positions $\{k_1,k_2,\ldots, k_n\}$, such that $1\leqslant k_1 < k_2 < \ldots < k_n \leqslant ...
8
votes
3answers
301 views

How to write a function-defining function which stores the function arguments in a stack?

I have a function-defining function SetAttributes[DefFn, HoldAll]; DefFn[f_[args___], body_] := f[args] := body; I am trying to modify this function to record ...
4
votes
1answer
169 views

HITS centrality

I want the centrality measure of a particular vertex in my graph, and for Closeness, Betweenness and Degree centralities I have been using : ...
11
votes
3answers
2k views

Programmatically generate packages from notebook files?

Currently, there are two ways I know of to generate a package (.m) file from a notebook file; one is to set the AutoGeneratedPackage option in the Option Inspector, ...
5
votes
4answers
2k views

Function for Autocorrelation

Is there a built in function to compute the autocorrelation of a signal ?
4
votes
3answers
629 views

Speeding up export of a matrix to a dat file

I'm trying to export a 1000*100 matrix of numbers to a .dat file using Export (I want the numbers to be separated by a tab) and ...
9
votes
1answer
193 views

How do I programmatically add to contextual menus?

To programmatically add to menus you can do as described here: How do I add to menus? What can I do to programmatically add to contextual menus? Is something similar to ...
12
votes
2answers
501 views

Saving a notebook without output lines

Is it possible to change the way Mathematica saves so that Out[] lines are never included? I have a .nb file that processes a ...
7
votes
1answer
162 views

How to sort cells in a notebook based on cell tags?

Suppose I have a notebook with cells tagged with both numbers and words with numbers always list first, and some cells without cell tags e.g.: ...
12
votes
2answers
954 views

How do I find the elements in a list that return the highest value for a function?

Suppose we have a list of values and a function f. I want to find which of the elements maximizes the return value of the function in Mathematica. Let call the ...

15 30 50 per page