# All Questions

195 views

### About auto-compiling and performance between Do and Fold

I was investigating how Fold could improve performance vs Do. I tested the code ...
201 views

### Poor CUDALink performance, when calling a kernel multiple times

When working on a project of mine I noticed that CUDALink shows very poor performance when calling CUDA kernels multiple times in a loop-construct. To demonstrate this I put together this little ...
263 views

### Simulating a quick return mechanism

Last time, I got a satisfying answer for simulating a toggle mechanism, just as expected. NDSolve is great. I tried playing with it (as a matter of fact, @MichaelE2 ...
98 views

### Is it possible to embed a cdf file into a GitHub Page

At the bottom of my page, I've added a piece of CDF js code, but it doesn't evoke the Wolfram CDF Player or Mathematica, so I can't play with it. And I wonder whether it's possible, since I know ...
75 views

### How do I use a passed-in symbol as a tag to define UpValues?

ClearAll@foo; foo[tag_] := ( tag /: tag[i_] := tag[[i]] ); a = {7, 8, 9}; foo[a]; a[2] I wanted the above to output 8, ...
187 views

### Solving Inequalities with Gamma Function

I am wondering why Mathematica outputs that the following system "cannot be solved with the methods available to Reduce". $\frac{\Gamma(\frac{1}{2}+n)}{n-1}<\frac{\Gamma(\frac{1}{2}+k)}{k-1}$ ...
139 views

### Mathematica Library

I created a Mathematica packagr and then I used the Needs function to add the library to my .nb file, but when use a function in my .nb file and the function is built in my library it comes up with ...
278 views

### Is there a guideline about when to end expressions with semicolons?

Whether for nested Ifs or within scoping constructs like Module and Block, I never know ...
69 views

### I need to calculate sin[x] series summation for sin[A] where A is a 3X3 matrix

I am evaluating $\sin(A)$ where $A$ is a $3\times 3$ matrix. I have calculated it but now I want to check this with a Taylor series expansion of Sin[x]. What I am ...
173 views

### Sparse Principal Component Analysis

I'd like to run sparse PCA on some economic data. There appear to be several R functions available including elasticnet and PMA but I wanted to check if anyone had something coded up directly in MMA ...
59 views

### How do I extend (prepend or append to) an existing TagSetDelayed rule? [duplicate]

I have a TagSetDelayed rule associated with, say, tag: ...
204 views

### Cancellation of common terms

Can someone explain why the term A in case 2 does not get canceled out when case 1 does? I use "9.0 for Microsoft Windows (64-bit) (January 25, 2013)" ...
26 views

### Math cell symbols not in italics [duplicate]

If I type $y(x)=ax+b$ in a math cell, y, x, and b are italicized, but a and x are not. How do I make them italicized? I tried adding an \[InvisibleSpace] or a \[VeryThinSpace] in between, and it ...
41 views

### How to construct a list in a For Loop nested in a Parallel Loop [duplicate]

I've the following problem I cannot solve. I allocate an empty matrix, v, of size n x m. Then I want to do a Parallel loop (ex. ParallelDo), and do some operations (described by a function ...
69 views

### formatting an InputField with Dynamic [closed]

I have the following code Style["(" InputField[Dynamic[t], Number, ImageSize -> 30] ")=" PDF[NormalDistribution[μ, σ], t], 16] which doesn't result ...
156 views

### Extracting argument sequences from function expressions

Why is it that fun[x, y] /. fun[z__] :> z leads to Sequence[x,y] but ...
58 views

### Avoiding RandomVariate update with use of Locator

I am preparing an activity that simulates the response from a noisy spectrometer. The function I use to generate the data has the form: ...
93 views

### Problem with Plot of Solution for NDSolve [closed]

I'm trying to plot the solution of an equation using NDSolve. For some reason nothing shows up in the plot. I checked the output of the interpolating function and it doesn't look like there is ...
376 views

### Labelling objects in a picture with numbers

I need help processing a biology bacteria picture. I just started learning Mathematica and I hope you guys can use a simple method to help me solve the problem, please do not use super complicated ...
336 views

### How to properly substitute values into variables?

I have an array of functions in terms of a[0] through a[n] and I wish to replace the a[]'s with previously calculated values p[0] through p[n], as in below: ...
123 views

### Discriminant of Characteristic Polynomial

I'm doing a calculation which finds the characteristic polynomial of a matrix with rather complex entries and then determines the discriminant of that polynomial. For smaller matrices up to around 7x7 ...
168 views

### Exporting strings without the quotes

I'm trying to export the following string "sep = ," to a CSV-file, as to be able to define the separation symbol. However, when using the following command: ...
306 views

### find connectivity

Imagine a chain of 20 rings, labeled by 1-20 sequentially. We want to make random size sets of numbers randomly chosen from these 1-20 rings. No duplicate numbers are allowed. Example of a set: ...
123 views

### Help to solve exponential equation over positive integers

I am trying to solve the equation $\frac{4}{9} = \big( \frac{1}{3} \big) ^n + \big( \frac{1}{3} \big) ^m$ with $n$ and $m$ both positive integers. I type into Mathematica the following In:= ...
134 views

### Graphics with shapefiles using tooltip

I'm trying to write a code that displays an entire shapefile color-coded by one variable, and then as the mouse is moving it shows the local regional area of interest with all its data Got a working ...
203 views

338 views

### Fast method for combining two lists

I have two lists, v1 and v2. Each element of the lists may be positive or negative. I want to create a list ...
108 views

### Best way to represent a joint distribution

The motivation for this question is producing a distribution that produces the gender and age of an individual when the distribution of ages depends on gender. Suppose I want a distribution which, ...
58 views

### How to stop a ParametricPlot3D from autorotating [duplicate]

The 3d graphic functions like ParametricPlot3D and ContourPlot3D always give me a rotating plot. Sometimes, I even can't stop it ...
295 views

### How to replace plus sign by comma

I want to replace plus by comma and the order of numbers in the list should be in increasing order. Example: a1 + a10 + a11 + a13 + a2 + a27 + a28 In this ...
109 views

### Solve system of non commutative operators

I'd like to use mathematica to solve systems of linear equations, where the entries are non commutative matrices. I just tried the NC package but it doesn't help so far. For example I can solve: ...
55 views

### Evaluating the tensor product many times for a given list

I need to evaluate the tensor product 10 times in a given list( {g,e,r}) Here I have evaluated for 3 times... ...
217 views

### How is the mysterious Raw function used?

I have never seen an example use for the mysterious Raw function: Raw[h, "hexstring"] constructs a raw data object with head h, and with contents ...
93 views

### Save open Mathematica Notebook from command line or second Notebook to avoid data loss

I was executing a long Mathematica Notebook over night. The Mathematica instance is running on a Linux workstation (in a vnc server session to be precise). Now I cannot access this session anymore, ...
396 views

### How to calculate the distance between UTM-projected coordinates?

My coordinates are projected using the following projection: proj= {"UTMZone32", {"GridOrigin" -> {500000, 0}, "CentralScaleFactor" -> 0.9996}}; Now I wish ...
187 views

### Reading binary strings from file as strings

I have a file that contains binary strings like 01011 00101 01011 I want to import the file to Mathematica as a list of strings, but ...
833 views

### How can I insert text into a relative position in a plot?

I use the following code to draw a parametric plot, with Epilog to add a point, and text using Graphics. ...