# All Questions

88 views

### Exporting a compiled function for later use

I compiled a function then used it in NMinimize. The computation took 19 seconds. Then, I exported this compiled function and restarted MMA and imported this ...
54 views

### Making a list of terms ordered by product order

I have some expressions f,g,h that are elements of a symmetric tensor algebra. The expressions are generated by a basis ...
202 views

### difficulty abstracting the OptionValue pattern

I am building lots of functions that use Options and OptionValue and wanted to reduce the redundancy in the expressions that ...
40 views

### Simplifying Products In Mathematica [on hold]

I have, amoungst many others, the function: Kbox[n_, r_] = ((n - r)*r)!/ Product[Product[(r - i + 1) + (n - r - j + 1) - 1, {i, 1, r}], {j, 1, n - r}] ...
272 views

### Find patterns in a list

again, I have a list like this: ...
105 views

I'm trying to do some calculations here, but for some reason Mathematica starts using numerical approximations that are no good for my work. Specifically: ...
30 views

### Proper EdgeForm setting so boundary appears entirely within shape

I have two neighboring (complicated) polygons that I want to be displayed with thick boundaries, however the two shapes border one another, and as EdgeForm places the line centered upon the polygon's ...
93 views

### FindFit with parameters which are simultaneously in initial conditions

I have RLC circuit. I would like to find R and L by using FindFit, but L is in initial condition and I have problem with it. Could you help me ? ...
45 views

### How to factorise a variable out of an indefinite sum?

(I should start by saying I'm a total beginner with Mathematica, so if the answer needs code I'll need it spelled out quite clearly, the learning curve for this is proving steep!) Basically what I am ...
24 views

### Dealing with dynamic tables [on hold]

Making dynamic vector variables is difficult in Mathematica. For example: X=Table[ToExpression["x" <> ToString@i], {i, 0,4}]; X[[2]] Yields x1. However, if ...
115 views

### Creating Correlation Table (and Working) With Missing Data

I am working with data that contains missing values (I have several variables (across the columns) and several observations (across the rows) in an excel spreadsheet). Example of the data structure: ...
35 views

### How to apply Gaussian kernel to smooth density of points on 2D (algorithmically) [migrated]

I have a set of points on a 2D surface and need to build a heatmap. However, I also need to smooth out the density/distribution by applying some sort of kernel (Gaussian kernel, for example). I Know ...
43 views

### Bandpassing EEG's using Mathematica's Bandpass Function

Let's say we have an EEG signal approximated using a fractional Brownian motion: ...
95 views

### Plot help with axes coordinates

Plot[{4 - 2 y, (5 + y)/3}, {y, 1, 10}] How do I make Mathematica tell me the coordinates for cuts with the y-axis, other than just looking at it?
62 views

### Table with dynamic iterator

I would like to make a Table whose iterator has a dynamically updated endpoint, i.e. Table[i,{i,1,Dynamic[n]}] Is this possible? Here is the context: ...
86 views

### How to limit number of user-defined messages issued per evaluation

I have written code such that if it runs into a particular function, a warning message is issued. However, it is common for the program to call this function several times in a single evaluation, but ...
72 views

### Use Style on list elements

I have a list like this: list = {0, 0, 0, 1, 1, 1} I want to color all the 0's in red, but I dont want to count through all the elements, like in my solutions, ...
211 views

### implement the ZOH in mathematica [on hold]

well I'm trying to implement the ZOH in Mathematica, but I can't. Take a look, this is my script: ...
59 views

### Trying to solve a trig identity [migrated]

Given $\sin 2x+\sin x=1$, find the value of $\cos 2x+\cos 4x$. I know $\cos 2x+\cos 4x \implies 1-2\sin^2x+1-2\sin^22x$, but didn't get the answer.
42 views

### How to pick out terms in a linear equation with a positive coefficient?

Basically I have a really large output which looks like a long linear equation $AAA-BAA-CAA+DAA+...-ZZZ$ And I only am concerned about those terms that have a positive coefficient (i.e. a plus in ...
258 views

### When must I use the Return function?

In a comment to my answer to this question, QuantumDot asks, "Where can I find more information on when I must use the 'Return' function?". I found this too deep a question to be answered by leaving a ...
67 views

### What is the order of execution of Animate?

I used to think the execution order of Animate is the same as For until I find: ...
88 views

### Trying to solve simultaneous equations based on format found on official website [closed]

\$\def\1{x_1}\def\2{x_2}\def\3{x_3}\def\f{f(\1,\2,\3)}\def\bs{\bigskip}\def\b{\begin{pmatrix}}\def\e{ ...
79 views

### How to combine Plot and GeoGraphics?

I want to combine this map as "background" of this combined plot. How can I do it? The documentation doesn't show any similar demonstration. ...
155 views

### Change appearance of ConvexHullMesh

I'm struggling to understand the behaviour of ConvexHullMesh (or rather the non-behaviour). I have a polynom p ...
103 views

### Adding a thick curve to a regionplot

Suppose we have the following simple RegionPlot: ...
85 views

248 views

### What is the correct way to use specific rule for specific pattern match when parsing an expression?

update: Thanks for the answers below. But I noticed they do not handle the following special cases: lis=1 and lis=z , ...
55 views

### How to find roots of a general 4th order polynomial equation [closed]

I have a fourth degree equation with 3<b<4 (if that helps): ...
49 views

### Error when using EquationTrekker

I just got to know EquationTrakker because I need to do phase graphs for my classes. When I load it ...
33 views

### Replacement with list element works, but yields error [closed]

random = {42}; c[1] /. c[i_] -> random[[i]] The above yields 42 as expected, but also gives this error: ...
167 views

### Keep Mathematica from simplifying functions with a specified Head

I want to run Simplify and/or Refine on various expressions, but keep it from touching anything that contains a specific ...
81 views

### Optimizing a function containing a complex exponential

I've noticed the following significant different in performance for different formulations of the same function: ...
135 views

### Isolating string characters

I have the following string: ...
116 views

### Can code optimize code?

Are there functions, programs or packages that deal with optimizing mathematica code i.e. re-writing ineffecive or convoluted code. -This question has haunted me since I joined SE. The background for ...
39 views

### Ivar error with Fit inside Plot

I'm trying to plot this Plot[Fit[med,{1,x},x],{x,0,10}] Why this doesn't work? I find out that if I do ...
53 views

### What methods does Solve use?

Could you tell me which method that Solve applies to solve linear and polynomials equations?
94 views

### NDSolve solution violates initial conditions

I have the following code: ...