All Questions
8
votes
0answers
40 views
What is the meaning of the last argument passed to the ColorFunction of a ParametricPlot3D?
According to the docs, the meaning of the arguments passed to ParametricPlot3D is $x, y, z, u, v$. This is 5 arguments: the Cartesian coordinates and the two parameters. Similarly, for ...
4
votes
0answers
41 views
How to create a floating image with no window background
When MMA 8 starts, a floating image of spikey is shown. As you can see the image has no rectangular border and the contents of the screen outside the spikey body are visible. We could say that the ...
4
votes
1answer
48 views
Removing edge weights from a Graph
How can I remove EdgeWeights from a Graph without affecting any other properties of the graph?
Let's construct a graph with weights:
g = RandomGraph[{10, 20}, EdgeWeight -> ConstantArray[1, 20]]
...
1
vote
1answer
64 views
Scoping inside of Module and Manipulate
This is driving me nuts: I'm trying to control the parameters for a relatively large system of ODEs using Manipulate.
With[{todo =
Module[
{sol, ode, timedur = 40},
ode = Evaluate[odes /. ...
5
votes
3answers
98 views
how to simplify symbolic integration
The following is the code:
In[3]:= Simplify[Integrate[f[x]*c, {x, a, b}]/c, Assumptions -> c > 0]
Integrate[c f[x], {x, a, b}]
----------------------------
c
but ...
2
votes
3answers
84 views
Finding roots of nontrivial equation
I am trying to solve the following nontrivial equation:
fun[z_] := (Log[Gamma[n]] + n Log[Gamma[z + 1]] + z n Log[n] - Log[Gamma[n (z + 1)]])/n
fun[z] /. n -> 8
m = Table[i, {i, -1, 1, ...
2
votes
1answer
42 views
MathLink and CDF
So far I have read that some things are not supported in CDFs. Istvan-zachar mentioned very useful things in his post. Unfortunately he mentioned that
MathLink operations, including J/Link and ...
2
votes
1answer
77 views
Start Mathematica without the menu bar?
Is there any way to start Mathematica without the main menu bar? To be precise:
Sometimes I make standalone mini-applications that I would like to just have in their own little windows without the ...
4
votes
1answer
56 views
Assumptions seem not to be considered
In the following a,b is a probability distribution, i.e. a+b==1 with a,b real, and in the interval [0,1].
If we try to maximize the Shannon entropy over this distribution using Mathematica, we can ...
4
votes
2answers
116 views
Random Geometric Graphs
I'm trying to implement an application which uses random geometric graphs in Mathematica, but it seems Mathematica lacks the functionality. I need the following functionalities:
Generate a set of ...
5
votes
2answers
47 views
Exporting images as .avi
Here's a list of images:
images = Table[ExampleData[i], {i, ExampleData["TestImage"]}];
And according to the reference "Export exports a list of graphics, images, or arbitrary expressions, taking ...
6
votes
2answers
91 views
Keeping Quotation Marks in Output
I am running into the following seemingly simple problem. I have this code:
testphrase="i love you";
input=ToLowerCase[StringSplit[testphrase, Whitespace]]
It outputs, input={i,love,you}
However, ...
3
votes
1answer
72 views
Frame or EdgeForm disappearing out of PlotRange
I am trying to obtain a thin frame around the bars in this chart but it's proving rather tricky. Can anyone suggest a solution?
size = {3, 12, 8, 0.5, 7, 5, 6, 7, 3, 4, 2};
bar[i_] := ...
7
votes
2answers
255 views
Dr. StrangeNumbers or: How I Learned to Stop Worrying and Love Floating Point Arithmetic
The following is the program.
test[t_, dt_] :=
Module[{}, For[ti = dt, ti <= t, ti = ti + dt, Print[ti];];
Print[MemberQ[{0.01, 0.02}, ti]]; Return[0];]
test[0.01, 0.001]
(* 0.001
...
...
4
votes
1answer
107 views
Performing a chi-square goodness of fit test
How would I perform a chi-square goodness of fit test? I have tried the following, where my data consists of the observed values whilst the data pair contains the correct values. Then I use the ...
1
vote
2answers
71 views
Question about making TabView remember what tab to open
Background: Consider the following ( for the purpose of illustrating this question ) simplified, but working snippet of code.
TabView[
{
{patt, "Pattern" -> 1},
{motif, "Motif" -> ...
15
votes
3answers
190 views
How to find all the local minima/maxima in a range
I want to find :
all local maxima in range
all local minima in range
From those points I can interpolate and combine functions upper and lower boundary. What I am really interested in, is the ...
1
vote
2answers
121 views
Some questions about random numbers
How can I get non-repeating random numbers from Mathematica 8?
How can I know which distribution the numbers I get are?
Can I choose the distribution I want together with the non-repeating random ...
1
vote
1answer
84 views
Cropping a plot via a command
I have a plot with some whitespace I'd like to get rid of. Ideally, I'd like to use a command like "ImageCrop", but for non-raster graphics (ImageCrop rasterizes the graphic). The Mathematica ...
7
votes
3answers
74 views
How to use the Combinatorica package without naming conflicts?
There are symbols in the Combinatorica package (such as Graph, IncidenceMatrix, EdgeStyle, and others) that have the same name as analogous symbols in System. If I execute Needs[Combinatorica`], then ...
2
votes
1answer
36 views
Automatic ticking without tick labels [closed]
Possible Duplicate:
Removing numbers from Axis in RegionPlot (and related functions)
I have a fairly simple desire: To use the automatic tick specification provided by Mathematica, but to ...
3
votes
2answers
38 views
TextAlignment->Center in a notebook with WindowSize->All
I'm creating a dialog with CreateDialog. I want one of its cells to have its text centered.
By default (and I like that default), the notebook created has WindowSize set to All, which I'm guessing ...
3
votes
0answers
24 views
MUnit test debug breakpoints in Workbench not working
When I create a breakpoint in Workbench 2 for an MUnit test, and run a debug build, the breakpoints are not breaking execution. The MUnit output is updated like a normal run without breakpoints. Why ...
6
votes
2answers
87 views
Starting NDSolve from intermediate time step?
I always wondered if I could start NDSolve from an intermediate time step.
What I mean is, in the code sample below, if I were to run my solution from tmin=0 to tmax=2 and then I realize that my ...
7
votes
2answers
95 views
Encoding format used by GraphicsData?
I am trying to extract some graphics stored in PICT format from a Mathematica notebook, using a platform that doesn't support PICT. If I look at the .nb file in a plain text editor, or if I use ...
3
votes
2answers
40 views
Manipulate and ExclusionsStyle
How can I change ExclusionsStyle for a plot inside Manipulate?
Here's a sample that (though it shouldn't) seems to produce equivalent result to ExlusionsStyle->{None}:
Manipulate[
Plot[{1/(a - ...
2
votes
1answer
75 views
Issue with Grid command
Dear all,
I've been trying to set prepare a grid with different charts for comparisons. The issue I have is that the first row of the grid has the legend distorted. The issue does not occur for ...
2
votes
2answers
67 views
Changing the speed of exported AVI videos
I am exporting an animation created using Manipulate in the .avi format. However the video runs very fast (I am putting it in Keynote). Its speed seems independent of how small I choose the step in ...
9
votes
1answer
76 views
Check does not interrupt evaluation of the expression when a Message is emitted
On the surface, Check looks like a good method to use when you need to abort the evaluation of an expression whenever a Message is emitted. Unfortunately, as the following code demonstrates, the ...
9
votes
7answers
197 views
Question about evaluation control
I want to make a function that takes a function as a parameter and prints an integral with the function inside. I've tried this:
L[f_, a_, b_] := HoldForm[Integrate[f[x], {x, a, b}]]
L[E^-Sqrt[#] ...
2
votes
2answers
56 views
Solving an equation and finding a couple of results given that they are integer
My problem is to find all solutions to an equation with 2 variables between two values that define the range of my search.
e.g., $(x+y-y²)/(1-y-x²)=0$ with solutions ${x,y} \in \mathbb{Z}$.
7
votes
1answer
90 views
Mathematica Source-Code Control for CDF files in multi-user scenario
Q: I'm putting together a strategy on how its best to maintain cdf documents with multiple users in a source code repository.
Ideally I wish for users to create (unit tested) cdf's with data and ...
2
votes
2answers
55 views
How to save data to a variable by clicking a button, using Widget Panel
In Mathematica I am trying to implement algorithm, for which I would like to have user friendly interface,
I have managed to create Panel using Widgets, but when I am trying to provide the value of ...
16
votes
2answers
198 views
Populating and storing a very large array in Mathematica
I am using Mathematica 8 to generate a very large multidimensional array of floating-point numbers and then store it in a file. Typical array sizes are 10000 x 50 x 15 x 40, resulting in a 3-4 GB ...
9
votes
3answers
133 views
How to use Locators on a graphic in a tabview
Background:
I want to split graphics in a Manipulate in several parts in a tabview control. But the tabview somehow interferes with the locators as in the following simplified example:
Manipulate[
...
2
votes
1answer
59 views
Is it possible to use styled (e.g., colored) text in PlotLabel?
Sometimes, I want to provide a key or legend for my Plot or ListPlot without using the PlotLegends package. Sometimes, I just want to use the option PlotLabel inside my Plot or ListPlot:
Plot[{x^2, ...
13
votes
3answers
183 views
Constructing a symbolic Hermitian matrix
I need to construct a symbolic Hermitian matrix like
m = {
{ n, a, b, b},
{Conjugate[a], n, b, b},
...
}
but I am not able to set the variables n, a, b in order to ...
10
votes
2answers
104 views
How can I turn off SingleLetterItalics in PlotLabels, etc, when the Options Inspector won't do it?
One of the requirements set for the graphing project I am working on is that plot and axis unit labels sometimes need to include superscripts. Here is an approximately minimal example (I have some ...
7
votes
2answers
110 views
Creating Marker (Tags) on Top of Plots
I am wondering and tried to plot a graph having labeling specified on top of the graphic. I kind of know a brute force method to accomplish it, but the results will not even look close to clean ...
4
votes
3answers
207 views
How do I plot Thomae's function in Mathematica?
I wanted to plot this function
$$f(x) =\begin{cases}
1 & \text{if } x= 0 \\
\frac1{q} & \text{if } x = \frac{p}{q}\\
0 & \text{if } x \in \mathbb{R}-\mathbb{Q}
...
4
votes
2answers
102 views
Converting a notebook to plain text programmatically
It is possible to export a notebook to plain text format (practically just extracting all the text from it and discarding formatting) using the File -> Save As... menu item.
How can a notebook be ...
6
votes
1answer
175 views
How do I get Mathematica to recognize a C compiler on a 64-bit Windows machine?
Mathematica does not recognize any C compiler on my computer. I run Mathematica 8.0.4.0 on Windows 7. I've tried to make sure various C compilers are installed on my computer, but I'm not sure how to ...
12
votes
3answers
198 views
Does parallel programming use up large quantities of memory in Mathematica?
When I start Mathematica with a fresh kernel and load a program I am developing to analyze biology data, the amount of used system memory is 1.9Gb (free memory is 14.5 Gb). These memory values are ...
5
votes
1answer
103 views
Simplify an expression containing NonCommutativeMultiply
How does mathematica evaluate the following expression to zero:
-a ** (b ** c - c ** b) + b ** (a ** c - c ** a) -
c ** (a ** b - b ** a) + (a ** b - b ** a) **
c - (a ** c - c ** a) ** b + (b ...
3
votes
1answer
121 views
Wald–Wolfowitz Runs Test
Does Mathematica 8 implement Wald–Wolfowitz runs test for randomness? I can't find it in the documentation. I would like to test some fit residuals.
6
votes
0answers
68 views
NotebookFind and String Pattern Expressions
Is there a way that NotebookFind can be used to match string pattern expressions rather than just strings?
The documentation for NotebookFind states that only a string, box expression or complete ...
2
votes
1answer
147 views
Why does the shape of my function change when plotted alongside another function?
I wanted to investigate the periodicity of functions so I tried to Plot them on Mathematica using the Plot function.
The particular function was $\cos(\cos(x))+\cos(\sin(x))$.
What I did was first ...
8
votes
2answers
84 views
Representing a value in an output as a self defined variable
I'm trying to find a way to have Mathematica always represent a numerical value as a self defined variable that I define using lhs=rhs. For example, if I execute
In[1]:=Solve[x^3 - 1 == 0, x]
...
8
votes
2answers
159 views
Speeding up random walk for many particles
I am trying to speed up this code for many particles to take a random walk. I'm not sure why it is so slow for such a simple task.
I got a few hints from colleagues to reduce the precision of the ...
6
votes
4answers
95 views
Evaluating a function using arguments from a sliding window over a list
I want to evaluate a function using arguments from a sliding window over a list.
As an example, lets use Mean as the function, window size as 3, and the list as Range[1, 10].
The results I am ...