2
votes
1answer
95 views

Graphing the amount of time a function takes

I know I can find out the amount of time a function takes to run like this: In:= function1[100] //Timing Out:= {0.043334, Null} How can I graph this over a set ...
6
votes
3answers
457 views

A deterministic function to generate a random number

Using Mathematica, I need to define a function of one integer variable that generates the same real number in the range 0 to 1, if it is called with the same argument, but gives a different real ...
1
vote
1answer
971 views

Plotting with Units

I'm trying to get Mathematica to plot with units, but I'm having some trouble. Below is a minimal example of trying to plot y = x, where ...
6
votes
1answer
181 views

Does pass-by-value affect the performance of function calls?

I only have a little coding experience in C, and I remember I was told that pass by reference is more efficient than pass by value since the parameters don't need to be copied. Since there is no pass ...
5
votes
1answer
994 views

OpenCL Dot Product

I have to calculate billions of dot products. My current implementation uses Compile to generate C code and it's very fast (10s ...
3
votes
1answer
215 views

Weird resampling when I try to export an Image

Mathematica language newbie here. I wrote the following code to quantize an image: ...
3
votes
1answer
2k views

Contour Plot in Cylindrical Coordinates

I'm trying to render an equation in the cylindrical coordinates, and I used the following codes: ...
0
votes
1answer
116 views

Strange function definition result [duplicate]

I'm relatively new to Mathematica, and I'm trying to define a function f(k) that would do the following: For any positive integer $k$, a finite sequence $a_i$ of fractions $\frac{x_i}{y_i}$ is ...
28
votes
3answers
777 views

How can I make points “glow”?

I have a set of points in the plane which I would like to have "glow". I would like for each point to glow individually and I would also like some increase in the intensity corresponding to an ...
1
vote
1answer
190 views

Problem with large values in ParametricPlot

I've got a question quite similar to No 18163:Problem with high parameter values in ParametricPlot, but the solution of that problem did not work for me. So I hope you may have another tip. I want to ...
11
votes
1answer
242 views

FindInstance returns Indeterminate in version 9, but not in 8

Here is a trivial system of equations in three unknowns for which FindInstance obtains a solution: ...
13
votes
2answers
1k views

Mathematica color schemes for the colorblind

Does Mathematica have a graphics option that makes plots intelligible for people with colorblindness?
2
votes
1answer
97 views

Notation not recursive enough?

My notation is not recursing enough. For example, Notation[W[a_ | b_] ⟹ foo[a_, b_]/foo[b_]] Notation[W[a__, b_ | c_] ⟹ W[a__ | c_]W[b_ | c_]] Then ...
0
votes
0answers
38 views

Correspondence between eigenvectors and eigenvalues [duplicate]

Let us say I have a matrix h (2x2). Now, I want to get the eigenvectors and eigenvalues of my matrix h: ...
17
votes
2answers
664 views

Helio chart for canonical correlation

I'm trying to create a chart usually called "Helio chart". It's a chart type very suited for canonical correlation analysis involving several dependent and independent variables. However, it is a ...
2
votes
2answers
539 views

Copy last/second last (etc.) input from history into current cell

I like to use terminals (e.g. gnome-terminal) where you can use the up key to copy the last command into the current input 'field'. For example, to repeat the last ...
2
votes
2answers
162 views

How can I create a table of sliders?

I'm trying to do the following: I have a table: w = Table[ToExpression[ToString[h] <> ToString[i]], {i, 1, Length[c]}] This table is suposed to generate ...
3
votes
1answer
116 views

Controlling margin around PlotLegends

Here's my code: ...
2
votes
1answer
263 views

How to completely reinstall Wolfram Workbench on linux

I've messed up my Ubuntu install, I've changed some pathnames I shouldn't have (don't know which ones exactly though), and after that Wolfram Workbench was not launching anymore. I uninstalled it by ...
5
votes
1answer
125 views

Where to find a summary for Q functions? [duplicate]

Is there a summary for all Function like NumberQ, LetterQ and so forth? data=123; IntegerQ[data] True
17
votes
3answers
1k views

What is the average of rolling two dice and only taking the value of the higher dice roll?

I am referencing to this question on mathunderflow: What is the average of rolling two dice and only taking the value of the higher dice roll? Now I tried: ...
4
votes
3answers
475 views

Separating positive and negative numbers into two arrays

$c$ is a vector with real numbers.I want to separate the positive ones and the negative ones into two vectors: $a$ and $b$. I have the following problem: When I do: ...
5
votes
3answers
693 views

Placing bar chart labels on the upper and lower frame axes

In the bar chart (with negative values) ...
2
votes
2answers
328 views

Solving and plotting ODEs while varying one of the initial conditions

How can I vary an initial condition in the numerical solution of a system of ODEs and then make a 3D plot of the solution space with that condition as one of the variables. ...
3
votes
1answer
175 views

How can I get all the results from a Wolfram | Alpha query?

When I query Wolfram | Alpha with "city in orange county, california", it returns the first four results with a note that there are "42 total". I can then hit the "more" button until all 42 are ...
-1
votes
1answer
1k views

Labels for each curve on a multi-curve plot using an efficient method(without writing a large code) [duplicate]

I have a question on plot labeling in Mathematica. I have y = 4 x / L + 2 where L = {10, 20, 30, 40} I want to draw a ...
4
votes
4answers
1k views

How can I make the Cartesian product of a list with itself? [duplicate]

I'm trying to build the table {{1, 1}, {1, 2}, {2, 1}, {2, 2}} given the list {1, 2} I can do it like this ...
10
votes
1answer
385 views

Kelvin per Kelvin Difference

I'm trying to use Mathematica units more often, but I've run into the following problem: ...
13
votes
5answers
526 views

Using ReadList and Skip to read a file with periodic alternation of useful and useless data

I am trying a read a file that's arranged such that there's alternating set of rows containing data that I don't need and data that I need. So for my case the first n lines in the files are useless to ...
6
votes
2answers
1k views

Calculating a minimum bounding box for a set of 3-space coordinates / spheres

I have a set of 3-space coordinates for the atoms of a molecule (I could also transform them into spheres with radii corresponding to the atoms they represent). I would like to place this molecule ...
1
vote
1answer
110 views

Draw only the top of the boundary of a function in Plot3d

So currently I have via combining 3 Plot3D's in a show. My question is how can I make it so that the ONLY portion of that border highlighted green, is the "curving portion" in the xy plane, rather ...
1
vote
1answer
903 views

Importing a matrix from a text file

I have a $4 \times N$ matrix in a .txt file of the form: -17.071 137.567 16.554 0.65 -16.873 136.138 16.934 0.7 -15.397 135.738 16.894 0.7 -14.7 135.982 15.9 0.6 ...
1
vote
2answers
1k views

Finding a best fit curve and plotting it [closed]

I have a list as shown below: m01 = {{250, 0.083121}, {200, 0.0888446}, {150, 0.0992422}, {100, 0.121567}, {50, 0.186825}} I'm new to Mathematica, and would like ...
2
votes
2answers
266 views
23
votes
4answers
494 views

Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs

Using global variables the following turns an "expression" into a Function: expr = 2 x; Function[x, Evaluate[expr]] Of course ...
8
votes
1answer
336 views

Running .NET/Link on Mono (On MacOS or any UNIX or Linux Distro)

Has anyone have any luck running .NET/Link on Mono? When I run .NET/Link to call Mathematica from within a Mono program, this is the error message I receive. ...
4
votes
1answer
194 views

How to find derivative of a numerical solution, where precision is ambiguous?

I am trying to take the derivative of a numerical solution. I am concerned that the way I'm doing this may be problematic due to numerical error; I think there must be a better way but I'm not very ...
1
vote
3answers
1k views

How do I create a matrix of functions?

I'm trying to create a matrix in which the elements are functions of two variables, but I can't figure out how to do it. Is it possible? The only way I could figure out is to define the matrix in ...
2
votes
1answer
151 views

Expression for the real 7/3 power

I need an expression for the real 7/3 power of a real-valued function, i.e., a reformulation of f[x_] := g[x]^(7/3) that works for negative values of ...
2
votes
1answer
606 views

Variable name string to expression

I'm not sure how to name this problem appropriately. But anyway. I have, say, three variables (arrays in my case), which I call: A1, A2, A3 I would like to ...
0
votes
1answer
94 views

Collecting roots of different equations and create a list

I solve two equations and have two solutions one by each equation. I want to create list of these roots. Could anyone please help me? Appreciate it. m02R150 = FindRoot[P1 == 0, {E1, 0.07, 0.1}] ...
2
votes
1answer
171 views

Executing C programs within mathematica [duplicate]

I have a requirement for executing a C program within Mathematica. The user will provide the inputs and the expected results on a front end. Mathematica runs the C file, obtains the result for the ...
5
votes
2answers
351 views

Variant of the cutting-stock problem in Mathematica

I'm pretty new to Mathematica and am trying to learn to solve problems in a functional way. The problem I was solving was to list the ways in which I could sum elements from a list (with repetitions), ...
0
votes
2answers
568 views

Copy and pasted graphics are fuzzy

I have a function that creates a 2D line with filling to the axis. When I copy this graphic into word it is very fuzzy, so much so that the numbers and text are almost unreadable, not to mention the ...
8
votes
1answer
311 views

How to remove some elements in a list based on a rule?

I want to deal with the following list. mylist = Table[cof[i] exp[i], {i, 1, n}]; (*n is very larege *) exp[ ] is a function ...
13
votes
3answers
288 views

Question about using a pattern in ReplacePart

I noticed that "ReplacePart" can use pattern. For example: ReplacePart[{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, {i_, i_} -> x] {{x, 0, 0}, {0, x, 0}, {0, 0, x}} So ...
4
votes
2answers
218 views

Extracting data from a table under conditions

I have a very large table with two columns. Let's say the name of first column is E and the name of the second is P. How can I get the E values when P = 0.
15
votes
1answer
1k views

2D Heat equation: inconsistent boundary and initial conditions

I'm attempting to use NDSolve on a 2D boundary value problem with initial conditions. Upon running my code, I get the following message: "NDSolve::ibcinc: Warning: Boundary and initial conditions are ...
7
votes
1answer
488 views

Filling only when one curve is below the other

I want to fill the area between two curves only when curve-1 (Black) is below curve-2(Blue). So In this example, I don't want the middle portion shaded but just the left and right tails to be shaded. ...
6
votes
3answers
796 views

Keep function range as a variable

Plot[2*x^2 - x + 2, {x, -1, 1}] plots a function of x from -1 to 1. As far as I can see, I cannot "save" this range in a variable: ...

15 30 50 per page