All Questions

3
votes
1answer
62 views

Raster to Image conversion problem

There are 3 ways to convert a Raster into an Image : only 1 works for me with version 10.0.1, and 2 work with version 9 (same computer, OS X 10.9.5) Has anyone the same problem or is it localized to ...
0
votes
0answers
31 views

how do I multiply two arrays in Javascript? [on hold]

I want to multiply two arrays, as in element per element: [1,2,3,4,5] * [2,3,4,5,6] = [2,6,12,25,30] I am new to JS and just have no clue... Thanks, Pam
1
vote
1answer
33 views

Multiway Systems Rules List Management

I'm working with a multiway system and I have a number of different mutation rule lists. I need an efficient way of managing which rule lists I apply. Here is the basic multiway system code that I'm ...
3
votes
2answers
101 views

Compute the average distance from the base of a rectangular pyramid to its apex

How can I compute the average distance from the base of a rectangular pyramid to its apex? For example, if the base of the pyramid is 30 feet by 8 feet, and the height of the pyramid is 12 feet, then ...
0
votes
0answers
21 views

ErrorListPlot Not Plotting

I'm on Mathematica 6.0, it's the copy my school gave me for a lab course. ErrorListPlot produces a graph, but there is nothing on it. I have checked the table constructed using ErrorBar and it's good. ...
4
votes
0answers
38 views

How to get data from DB into dataset with keys

I'm a Mathematica newbie and I have the following problem: I connect to a Oracle DB and read out a set of variables, further on I want to histogram some of the variables. A Dataset seems to be the ...
1
vote
1answer
99 views

Making a list of rules form the list of elements

Starting from the list: {f[q1, q2], f[q3, q4], g[q1], g[q2, q3, q4], d[k1 - q1], d[k2 - q2 - q3 -q4]} I would like to get the result: ...
1
vote
1answer
97 views

Basis for the intersection of vector spaces

The MuPAD Notebook Interface provides the linalg::intBasis function: http://www.mathworks.com/help/symbolic/mupad_ref/linalg-intbasis.html How can I get the same ...
0
votes
1answer
127 views

How to construct new geometrical shapes in Mathematica?

In this question of mine I asked for how to implement a 2D random walk within a bounded area. In the provided solution one can use Rectangle[{-10, -10}, {10, 10}] ...
9
votes
2answers
355 views

Phase portrait on a cylinder

It is very nice and very easy to make a sketch of a phase portrait with StreamPlot. For example, for the classical pendulum, defined by $$ \dot x=y,\\ \dot y=-\sin x, $$ The code ...
3
votes
1answer
46 views

Clustering image data by intensity and position

I'd like to apply FindClusters or ClusteringComponents to image data of an indistinct edge, with the goal of segmenting the ...
2
votes
3answers
76 views

Legend placement explanation

Could anybody explain, how the coordinates in Placed influence each other? ...
0
votes
0answers
48 views

Usage of @ symbol in Mathematica [duplicate]

What is the purpose of @ symbol? Also, I would appreciate if somebody could provide a webpage where such functional special symbols are documented
4
votes
1answer
62 views

RegionPlot with PlotRange vs RegionPlot with domain

Consider you want to plot R = ImplicitRegion[x > 0 && y == -((5 x)/3), {x, y}]; In ContourPlot of an ImplicitRegion defined by the intersecton of ...
0
votes
3answers
56 views

High-Precision NSolve

I need to calculate the intersection of two curves f1[x_] := ((Zl ρ ) Exp[-x]) f2[x_] := (α k e^2 /x^2) Where ...
5
votes
0answers
47 views

PenaltyFunction Option in NMinimize

I am curious if anybody has some experience in using the built-in Option "PenaltyFunction" in any of the numerical optimization functions like NMinimize. According to the documentation the user ...
1
vote
3answers
144 views

Pare down list recursively

What is the best way to pare down a list whereby the $n$th number is removed from the list recursively? This ...
2
votes
1answer
211 views

Quick way to tell if matrix is integer-only?

What's the most shortest one-liner code to tell whether a matrix is integer-only? I've come up with: Length@Cases[A // Flatten, _?(Not@*IntegerQ)] == 0 but ...
0
votes
2answers
37 views

How to use Expected values in symbolic solving

How can I create a function that brackets off terms of an expectation value? For example, I have : f = a[x] + c1*b[x] + c2*c[x]; g = Expand[f*f]; ...
4
votes
3answers
73 views

How to separate factors by dependent variables (arguments)?

How can I separate factors in an expression by their dependent variables? For example: expr = b * c[2] * a[x] * 2 * x^2 * g[x,y] * z[r] * D[q[x], {x, 4}]; I ...
2
votes
3answers
55 views

Tangled up in sequences and recurrence relations

I took a trip through sequences and recurrence relations and I got tangled up since the documentation didn't help much. I'm sure you can. Given a sequence ...
1
vote
2answers
31 views

Exporting mixed data of matrices and vectors / lists

thank you for reading my question. I have a problem trying to export mixed data from Mathematica. I have different matrices and vectors, which should be combined to a output file. Here a ...
2
votes
1answer
63 views

Scale coloring of ContourPlot

The answer given here solved how to use the same color scale across multiple plots within the function ListContourPlot. I can't for the life of me map this solution onto the function ContourPlot that ...
308
votes
12answers
56k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
11
votes
5answers
3k views

Division by zero is slow

Suppose I have two arrays of data, which I want to divide: ...
2
votes
0answers
42 views

Temporary variable not removed in Mathematica 10

In Mathematica 10, the documentation still states that a symbol with attribute Temporary will automatically be removed when it is no longer needed. Now consider ...
4
votes
1answer
91 views

Problem on limit involving complex numbers

I have $${\frac{(6 k+1)^{k}}{(2 k+5)^{k}}}*(z-2 i)^k$$ and I need to find it's limit for $k$ approaching infinity. ...
0
votes
1answer
14 views

Numeric-type attributes for symbols (analog of NumericFunction)

Is there an attribute for symbols that makes NumericQ give True? For example Pi and ...
1
vote
1answer
113 views

Can telescoping Nicomachus' triangle down to the number line by using `Graph` be done?

I noticed a pattern in Nicomachus' Triangle that might be used to reduce the triangle to the number line. If the Edge size could be set to the absolute difference ...
1
vote
3answers
79 views

How to extract arguments of functions in an expression?

How can I extract the argument of a function in an expression? expr=b[c]; I need some f[expr] that will return c. d[f[expr]] -> d[c]
8
votes
1answer
845 views

Drawing a graph with specified edge lengths

I was wondering if it was possible to ask Mathematica to draw a graph provided some set of vertices: $(v_1, ..., v_N) \in V$ connected by $M$ edges $(e_1, ..., e_M) \in E$, where the length of each ...
1
vote
1answer
62 views

Plotting a function in {X(Y),Y} space

The code below generates some data and defines a function f[x,cb]:=NMaximize[expr,x] that upon being evaluated returns: {function value at max $x$,the function maximizing $x$}. ...
0
votes
0answers
9 views

Difference Equation System constructed with SetDelayed: How I can set Non-exploding break?

I have a Difference Equation System constructed with SetDelayed. The system is like as follow. ...
2
votes
5answers
163 views

Is there a way to use Table[] without having to calculate my function twice?

I'm trying to use Table[] more to be more in the spirit of Mathematica. So for example, I might replace this piece of code: ...
0
votes
0answers
14 views

what's the difference between CreateKernelLink() and CreateKernelLink(String Arg)?

I have a .NET program which will connect to MathKernel. When the program runs, there will be a icon of MathKernel on the taskbar. ...
3
votes
1answer
60 views

NIntegrate on tetrahedron

I've been trying to numerically calculate an integral in a tetrahedron of a discretized domain. In some cases when I specify a method I've been getting the error message NIntegrate::femonly ...
0
votes
1answer
46 views

Display trailing zeros in ticks

When I specify tick marks in ArrayPlot I want to keep the number of trailing zero's that I specify. One work around is to use a label for that tick mark (i.e. Ticks->{0.8,0.9,{1.0,"1.0"},1.1,1.2}), ...
4
votes
2answers
190 views

How to get a uniformly distributed list of points from a B-spline function

I created a spline function from a list of points and made a plot as follows: ...
2
votes
1answer
31 views

ChartLegends only displays the last two legends in the list

I would like to add 4 legends on a simple bar chart below, but only the last 2 legends appear on the graph. ...
4
votes
4answers
121 views

ArrayPlot with variable width bars

I've been using a DateList plot to visualise property information but I don't think it's the best way display my data. My data is formatted as {time (hours), property} where property is an integer ...
0
votes
0answers
25 views

How to set the step in NMinimize

I want to fit multiple data sets with 104 variables. I use NMinimize to do that. I minimize the difference between data and my objective function. How can I tell ...
1
vote
2answers
62 views

Integration over a (non-parametric) curve defined by indicator function

I want to integrate the real function myFun defined on a 2D plane over the line locus, defined as the solution of a set of ...
2
votes
1answer
95 views

Neighbourhood - Calculations

SeedRandom[0]; n = 5; (m = N @ RandomInteger[{1, 3}, {n, n}]) // MatrixForm result1 = MeanFilter[m, 1] // MatrixForm ...
6
votes
1answer
174 views

Poincaré map for dynamic billiard

There's a very nice demonstration of dynamic billiard written by Dan S. Reznik that can be found on demonstrations wolfram(along with the code): here I was thinking whether it would be possible to ...
12
votes
1answer
193 views

Why do big-O terms disappear in definite integrals since Mathematica 9?

In Mathematica 8, when I computed the following input: Integrate[Series[Cos[x], {x, 0, 2}], {x, 0, a}] Mathematica returned an expression that had a O[a^4] in ...
1
vote
1answer
52 views

Collect powers of variables and integers separately?

Let expr contain a sum of powers of x with some coefficients ci. The exponents of ...
2
votes
0answers
27 views

Max iterations in K-means clustering algorithm

I want to use k-means for clustering. I have used the ClusteringComponents function but I said how can I control the max-iteration for k-means ?
6
votes
2answers
171 views

How to redefine the type of multiplication in Det

I would like to redefine the type of multiplication that is used in Det (calculates the determinant). Instead of the standard multiplication I would like to use a custom function Fun[a,b] (which takes ...
1
vote
0answers
34 views

FinancialDerivative function call without parameter fails in Mathematica 10

When I type FinancialDerivative[] in Mathematica 10. There is error listed as follows. Anybody know how to solve it? Thanks.

15 30 50 per page