1
vote
1answer
146 views

boolean return value in mathematica

why does the following instruction ok in mathematica, and it returns a boolean value In[398]:= catenary[x, 1, 0, 0] == catenary[-x, 1, 0, 0] Out[398]:= True and ...
16
votes
3answers
549 views

Function that counts the number of arguments of other functions

I have a newbie question: is it possible to write a function that counts the arguments (total and optionals) of a given function? Possibly it should be able to work with built-in and custom functions ...
2
votes
1answer
329 views

Laplacian or Grad of an InterpolatingFunction

For obtaining a Schlieren image from an equation for density, I need to calculate the first derivative of density and make a contour plot. The below code snippet calculates the first derivative w.r.t ...
1
vote
3answers
2k views

How to write values of function to file?

For example, say I wanted to plot Sin(x) like this: Plot[Sin[x],{x,0,2 Pi}] But instead of plotting to a graph, I want to now tabulate the values of Sin[x] to a ...
1
vote
2answers
141 views

How can I crop manipulator from a plot

I wanted to know how can I crop a Manipulator from a plot. the code for plot is ...
3
votes
4answers
1k views

how to plot $x=0$ and $y=0$

I tried to plot plane $x = 0$ and $y=0$ with Plot3D[x = 0, {x, -4, 4}, {y, -4, 4}] but it seems that it didn't work out. How can I plot the above planes? Also ...
2
votes
2answers
234 views

Varying plot sizes for identical PlotRanges in ListLinePlot, where one has a legend

I am trying to make some figures using ListLinePlot in Mathematica 8. Although the PlotRanges are the same, the resulting frame sizes are different. The only difference (as I see it) between the two ...
14
votes
1answer
511 views

Parallel compiled functions running on parallel sub-kernels

Question Why is it, that compiled, Listable, parallel functions which work perfectly fine on the main kernel, do not run in parallel on sub-kernels? Details ...
19
votes
2answers
2k views

How to make Fourier behave like FourierTransform?

I'm not very experienced with Fourier Transforms, so there may be something inherently wrong with attempting to do this, but how can I make the discrete Fourier behave like the continuous ...
7
votes
1answer
392 views

Want Interactive PlotRange of Graphics[{}]

I am trying to do: ...
4
votes
2answers
217 views

Formatting text through pattern matching

I am trying to format some text based on some patterns. ...
7
votes
1answer
300 views

Is it possible to construct a function to make a poor man's Mathematica database?

I have a function that is set up to write to a database with 10-20 standard variables with 10 fields each, but the application is going to a place where database access is not available. Can ...
7
votes
2answers
1k views

Create complicated text formulas in graphics

I want to put somewhat complicated, or at least non-standardly formatted, text on some of my graphics. For example, I'd like to be able to use f^[4](x) (where the ...
16
votes
2answers
873 views

How do I perform string matching and replacements?

What are, and how do I use Mathematica's string matching and replacement tools?
7
votes
3answers
245 views

Safely nesting RuleDelayed

Say I have the following, straightforward-seeming functions: ...
16
votes
5answers
2k views

The difference between 0. and 0

I have a function for which 0 is a special case: f[A___, 0, B___] := 0 But since I am doing numerics, sometimes in the course ...
11
votes
3answers
172 views

Emulating Sequence with my own function

I just considered if/how one could implement Sequence in Mathematica if it were not predefined. It turned out that the following simple definition has in all my ...
2
votes
4answers
182 views

Remove anything between () except for ; in a string

A simple question but I can't find the answer. I'm scanning a huge pile of mails and would like to get rid of anything between () in the email adresses since this normally contains just info that ...
3
votes
2answers
719 views

Use ColorFunction in ListLinePlot with If

The following code ListLinePlot[{2, 4, 6, 8, 10, 12}, ColorFunction -> Function[{x, y}, If[x <= 3, Blue, Red]]] should produce blue lines for $x\le3$ and ...
4
votes
1answer
107 views

Is there a way to programmatically do a “save as ” on an init.nb file to save it as init.m?

I am using Mathematica 8.0.4.0 running under Windows 7. Is there a way to programmatically do a "save as " on an init.nb file to save it as init.m? In the documentation center under ...
6
votes
4answers
285 views

Why does my function defined with constraints on patterns not work? [duplicate]

Possible Duplicate: Why doesn't PatternTest work with Composition? My function is something like this, ...
11
votes
2answers
513 views

What is the precedence of FrameStyle, FrameTicksStyle, and LabelStyle? How to have a LabelStyle different from FrameStyle

From the documentation: Plot[2 Sin[x], {x, 0, 10}, Frame -> True, FrameLabel -> {x, y}, PlotLabel -> 2 Sin[x], LabelStyle -> Orange] But then add ...
2
votes
2answers
405 views

Unexpected result of summation

I wrote small module that gives me incorrect output-set, it should be a single number! I don't understand what went wrong. This is the form of summation used: $$\frac{1}{2} (b-a) \sum_{i=1}^n ...
4
votes
1answer
1k views

exporting list of matrices in mathematica

I am working on some problem which requires generating a list of random matrices. So I used the code (actually a shortened version of the code, but it does not matter) ...
28
votes
2answers
800 views

How can I set an image to be the Notebook's background?

Is it possible to set a notebook's background to a nonscrolling image?
6
votes
5answers
288 views

Is it possible to insert arguments into functions when they're used like Function@ or //Function?

Is it possible to insert arguments into functions when they're used like Function@ or //Function? Sometimes I need to do this, but then I have to return to the standard function usage: Function[] ...
11
votes
4answers
443 views

Calling Table with custom iterator

I often find myself in situations where I, for example, need to build a table for some expression, but want to set the number of points rather then the step size, so the code ends up looking like this ...
7
votes
4answers
207 views

Are persistent variable values after the kernel is stopped possible?

Is there a way to make values of variables persistent even after the kernel is stopped? Example, if I were to set up a list for which I append new list items (such as a check ledger, as a basic ...
5
votes
1answer
132 views

New display format needed: “drag box”

I want to create a new display type, especially for numbers or text, but potentially for arbitrary objects as well. I want a "drag box" where not all of the number (object) is visible, but dragging ...
6
votes
1answer
317 views

Support for Multidimensional Scaling (MDS)?

Does mathematica support MDS? Or, are there any libraries that support it? Basically, I have points and a distance function defined between them, and I want to plot them in 2D space, trying to ...
3
votes
1answer
280 views

Manipulating a catenary in Mathematica

I have a catenary curve in Mathematica, and I wanted to add a variator (dimmer) with Manipulate, so that the user can modify the value of the x/y-coordinate of the ...
14
votes
4answers
574 views

Implementing a function which generalizes the merging step in merge sort

One of the key steps in merge sort is the merging step. Given two sorted lists sorted1={2,6,10,13,16,17,19}; sorted2={1,3,4,5,7,8,9,11,12,14,15,18,20}; of ...
12
votes
3answers
1k views

How to set tick label precision

When I make a plot like Plot[Exp[x], {x, 1 - 10^-9, 1}] The resulting plot looks like . Notice all the ticks on the x-axis are all labeled 1. Is there any ...
14
votes
1answer
2k views

Edit a Mathematica plot in Illustrator, missing font problem

I export my Mathematica generated plot as an eps and then open it in Adobe Illustrator to make a few changes. When I try to do this I get this error message: Times-Roman: Font not found on ...
4
votes
2answers
289 views

Color based on (discrete) derivative of function

I am making a very basic stock simulation. I want ListLinePlot to color my stock viewer based on whether the price went up or down from the previous price. Here is ...
4
votes
1answer
121 views

What is the syntax for selecting multiple layers in an Overlay?

From the documentation: Overlay[{Subscript[expr, 1],Subscript[expr, 2],...},{i,j,...},s] allows selections to be made and controls to be clicked in Subscript[expr, s]. and an example of ...
8
votes
5answers
568 views

can the color in MeshStyle be specified by a ColorFunction, such as “SunsetColors” for example. If so, what is the correct syntax?

This is an example given in Help: Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, MeshStyle -> Gray] Could this be changed to something like ...
2
votes
1answer
733 views

Export Animate command to MOV video

I'm trying to export a rather complex Animate command into a full-HD resolution video, but having no success so far. The animation has around 520 frames (the number ...
6
votes
3answers
157 views

Use Slider2D to add data points to a list

This bit of code sets up a list with the first entry already in it -- {{1,1}} ...
17
votes
3answers
2k views

How to calculate volume of convex hull and volume of a 3D object

I have a set of random 3D data points. How can I calculate the volume of the convex hull?
2
votes
1answer
181 views

Need more float precision

I have a Physics problem which huge and tiny numbers and Mathematica just gives me a speed of my particles which is the speed of light. Then $1/\sqrt{1-v^2/c^2}$ becomes singular. If I use smaller ...
2
votes
2answers
120 views

How to evaluate this product

I was trying to evaluate this product $$ \sin (1^\circ) \sin (2^\circ) \sin (3^\circ) ... \sin (88^\circ) \sin (89^\circ) \sin (90^\circ) $$ But I think it got weird results with this ...
12
votes
3answers
674 views

What compilers are “suitable” for CompilationTarget->“C”?

The documentation for CompilationTarget says, "if you do not have a suitable C compiler then you will not be able to set CompilationTarget to C". Well at this time, I don't have a compiler installed ...
8
votes
2answers
294 views

Why do I have to put Evaluate[] here

I wanted to draw some contours. I succeeded with this: ...
9
votes
3answers
465 views

Different calculation of median and quartiles, bug in BoxWhiskerChart?

When you plot a dataset with BoxWhiskerChart passing over the box in the plot with your mouse pointer shows some specifics about the dataset (min and max values, ...
6
votes
1answer
153 views

How to reduce expressions with complex coefficients in the form of a+0.*I

I'm trying to get an eigenvalue equation in Mathematica, and the result is an expression with coefficients of the form a + 0. I. For example, Is there any clever ...
5
votes
3answers
236 views

HoldFirst and inserting additional options into a Grid of Graphics

This is related to my earlier question, but is specific to an issue I have encountered with the use of the HoldFirst First, let's create some fake data for ...
2
votes
0answers
276 views

Having difficulty with the Minimize command

I am having trouble getting an answer to this question...Am I missing something that anybody can see. ...
23
votes
2answers
1k views

Do I have to code each case of this Grid full of plots separately?

I have written some custom functions to draw multi-panel graphs like this one: It's done by passing a matrix of (custom) plotting functions to a MultiPanelGraph ...
20
votes
3answers
807 views

Calling external commands without showing command prompt on windows

I'm playing around with some code that's calling external command-line commands on a windows platform, and when doing this, the command prompt will pop up quickly and then disappear. This is not a ...

15 30 50 per page