3
votes
1answer
119 views

Dynamically apply a function fed by Input[]

Here is a bit of code: funlist = {Plot,ListPlot}; Input[Panel[PopupMenu[Dynamic@whichfun, funlist], "blabla"],Dynamic@whichfun] The idea here is to select what ...
12
votes
3answers
221 views

Selective evaluation of blocks of code in a Manipulate

Is it possible to attach certain pieces of code to certain controls in a Manipulate? For example, consider the following Manipulate ...
5
votes
2answers
212 views

Adapting CoefficientList (and the related functions) to work with Laurent polynomials

Is there a slick way to make CoefficientList (and the other similar functions, CoefficientRules etc) work for Laurent polynomials (i.e. where negative exponents can occur), if I don't know a priori ...
7
votes
4answers
2k views

How can I manipulate the number of decimal places in the frame ticks?

Is there any simple way to increase or decrease the decimal places in the frame ticks. I want to make the y axis ticks of the first two and the second two graphs look similar.
3
votes
2answers
141 views

Dynamically show usage

As the title states I would like to dynamically show ::usage on several functions. Let's consider two functions here: ...
2
votes
0answers
52 views

Why does AbsoluteOptions give the wrong answer for ListPlot? [duplicate]

I'm trying to get the PlotRange from a ListPlot graphic: ...
6
votes
1answer
800 views

Fastest way to do vector / matrix multiplication with constant matrix

Suppose we have a fixed n x n matrix, call it $B$. What is fastest way to evaluate $v^t B\;v$ over many different vectors $v$? Since $B$ is a constant matrix, does this allow the number of operations ...
1
vote
1answer
75 views

Exporting data which includes rule as number only and use lhs as label

I use listD1 = Table[FindRoot[(*my eqns depending on k*), {k, conc}] to get a list of solutions for the different values of ...
2
votes
1answer
408 views

How do I resolve the “Specified file is not a MathLink executable” in SerialIO package?

I've read and tried the previous StackExchange suggestions here about installing the SerialIO package (including placing SerialIO in the same folder as init.m and and editing the init.m file per ...
3
votes
1answer
324 views

How to find the roots of an equation which is almost singular everywhere

I'm trying to find the roots of the equation as a variable of k: ...
9
votes
1answer
341 views

How to convert Graphics3D object into an Image3D object?

How does one convert a Graphics3D object into an Image3D object? E.g., start with ...
0
votes
1answer
128 views

Efficiency problem with least square algorithm (Error in both variables)

I was informing myself about the least square algorithms with errors in x and y. I found this post and the top answer wasn't ...
2
votes
1answer
114 views

Distances of locations in the matrix form

I want to have the distances of the cities in the matrix form.How can I have it for example for the cities like followings that also includes the distance of the city from itself which is zero: ...
3
votes
3answers
949 views

Implementing Newton's method

I have this question on coding Newton's method in Mathematica. I have some code to go by but I have no clue if it's computing the functions in the right order. The book is the numerical methods ...
5
votes
2answers
133 views

How can AbsoluteTimes be split by date faster?

I have data where the date is stored as an AbsoluteTime. Here's a dummy dataset: ...
5
votes
1answer
231 views

How to speed up multi-curve plotting?

The following example is a very simplified version of the problem I'm working with, though I hope it still captures the essentials. First, the definitions: ...
4
votes
1answer
111 views

Define a color of the pressed button of a SetterBar

It is easy to define a background color for the SetterBar buttons, so that all the buttons that are not pressed have the specified color, while the pressed one is gray. Here is the example: ...
1
vote
2answers
155 views

What's the wrong when I use NestWhileList?

Problem : A Happy number is a number that if one squares its digits and add them together, and then take the result and square its digits and add them together again and keep doing this process, one ...
13
votes
1answer
309 views

How to enlarge $\it{Mathematica}$'s knowledge about certain functions?

I'm often troubled with the following task. I need to carry out symbolical computations involving certain special functions. Let me take as an example Barnes gamma-function. It is included in ...
2
votes
2answers
377 views

Recursive formula involving a piecewise function

I am trying to construct a recursion, g[t], where g[t] = a[t] if g[t-1] = 1 ...
6
votes
2answers
786 views

Band-pass filter an image

Ok so i have some HR-TEM images. In this technique fringes appear whereever a crystalline structure is present. This fringes are separated by a certain distance depending on the material, this is our ...
2
votes
1answer
146 views

Delay of events detection dependent of “MouseDown” position

Let's say we have a Rectangle with color which depends of CurrentValue["MouseOver"]: ...
8
votes
2answers
276 views

Labeling a three-dimensional plot

As the title says, I want to add some text in a three-dimensional plot, thus labeling specific parts of it. Here is the corresponding Mathematica code ...
3
votes
1answer
87 views

quadratic constraint feasibility

Suppose that $A$ is an $n \times n$ matrix, and I have observed some entries of $A$, say, $A_S$ ($A$ restricted on $S$) for some subset $S$ in $\{1,...,n\} \times \{1,...,n\}$. I want to know if it's ...
4
votes
3answers
604 views

Log-log scale smooth histogram

How can I create a smooth histogram with a log-log scale? I can use Histogram[data, "Log", "LogCount"] to get a log-log histogram, or I can use ...
3
votes
1answer
158 views

Any way to speed up evaluation in an Animate?

I have a self-defined function which is fairly complicated and gives the analytical form. The result contains two independent variables. I use Animate to plot the ...
1
vote
4answers
117 views

Help with writing a polynomial series [duplicate]

I want to write and evaluate an expression something like Sum[x[i] Product[y[j], {j(!=i), 1, n}], {i, 1, n}] but with correct syntax, where n is a any number ...
0
votes
1answer
194 views

Plot complex path (essentially a 2D path) expressed in one real parameter

Consider a complex path expressed in one real parameter, such as $$f(\alpha)=\frac{1}{e^{i \alpha} + 1},$$ which is a Möbius transformation of the unit circle. I know I can expand it all out and use ...
9
votes
1answer
280 views

Mathematica: computing a difficult integral

I am trying to compute the following integral: Integrate[Exp[Sum[-((cw λ - b[i])^2/(2 σ^2)), {i, 1, n}]], {cw, 0, 1}] And currently Mathematica outputs ...
0
votes
1answer
78 views

Can I specify the style of plot for some element in discrete plot?

I am using discrete plot to plot a 1D array. But I want to plot some points specified by a span in one style (for example, in red) and the rest points in other style (e.g. in blue).
6
votes
1answer
285 views

Forcing Mathematica to use certain simplification rule

I'm trying to force Mathematica to use following transformation function ...
2
votes
3answers
138 views

Any way to reverse span and join two span in Mathematica?

I port a matlab code to mathematica. In the original matlab code, I use ":" to pick up the desired elements in a matrix. In mathematica, I find in the documentation that the span operator is ";;" ...
2
votes
1answer
149 views

How to embed graphic-element-specific metadata within a Graphics object?

One of the most crucial requirements for rich, interactive scientific graphics is being able to "annotate" individual graphic elements (e.g. the data points of a scatterplot, the individual curves in ...
9
votes
2answers
1k views

Implementation of smoothing splines function

I have some problems by writing a module for spline smoothing. Actually i am trying for about two weeks. My listing is here: ...
6
votes
1answer
93 views

Where does Documentation Center introduce the basics?

While helping a user who mistakenly thought that log rather than Log was the correct built-in function name, I included a ...
0
votes
2answers
172 views

how to export nested list

I have a ListPlot where I extract my data again using pts1 = Cases[(*I put my list plot here*), , x_Point :> First@x, Infinity]; which gives me the data as ...
8
votes
3answers
2k views

Keyboard shortcut to evaluate notebook

(If this is entirely trivial, although I couldn't find an answer as much as I searched the archives, I will delete the question.) How could I add a keyboard shortcut to evaluate the entire notebook ...
1
vote
2answers
200 views

Highlighting a single Period of a Trig Plot

How do I highlight a single period of a trig function say by using color and/or thickness when the graph itself extends further than just a single period? Thanks...Gregory Lane
0
votes
2answers
93 views

Elegant way to transform formula with sum into code

I have this formula, and many other which contains sum, I am perfectly able to do the computation over a list, however to do this I need to do it in several manual steps. Therefore, I wonder if there ...
2
votes
2answers
232 views

How to replace subscript symbols

I have an expression with subscripted variables. I would like to replace all those terms with other symbols. For example, $P_1 + P_2^3 \rightarrow P1 + P2^3$ I used the following code but it doesn't ...
0
votes
2answers
1k views

Solving a system of nonlinear coupled ODEs

I tried using NDSolve to solve the following system of equations: ...
-4
votes
1answer
596 views

Plotting a piecewise parametric curve [duplicate]

I have no idea how to plot the following piecewise parametric curve in Mathematica; ...
0
votes
2answers
86 views

Generate higher dimensional box vectors

I'd like to generate integer vectors in $\{-M,-M+1,\dots,M\}^n$, where $M$ and $n$ are parameters. For a fixed $n$, say $n=3$ for instance, I only know I can use ...
8
votes
1answer
127 views

How to always display current section identifier (number, name) in notebook?

Because I find myself relocating frequently within a long notebook divided into sections, subsections, & subsubsections, I would like to display the identifying information for the section, etc. ...
3
votes
5answers
439 views

Elegantly adding two differently spaced lists of ordered pairs $(x, y)$

Suppose that I have two lists, list1 and list2, of ordered pairs $(x, y)$. The two lists are differently spaced in $x$; some ...
3
votes
3answers
402 views

Mixing Text and Formulas

I'm trying to do some typesetting in which I mix text with formulas. The Mathematica documentation has a section titled "Mixing Text and Formulas" which pretty ...
1
vote
0answers
164 views

NDSolve error when solving pde

I am trying to calculate speed of viscous fluid in a rotating hollow sphere. The sphere is rotating round z axis. The fluid is incompressible. I used Navier-Stockes equations. The only boundry ...
1
vote
0answers
194 views

Jumps in NDSolve results

I need to compute using NDSolve routine, some function $F(x)$, having two possible values $F_1(x)$ and $F_2(x)$ depending on whether the argument exceeds some ...
3
votes
3answers
252 views

How to partition a list into sublists in a similar way to Histogram

I have a list of list as below (I show part of it) ...
5
votes
2answers
222 views

Ranking a vector containing ties

How can I rank a vector such that the ties are replaced by their middle ranks. For example, {1, 2, 2, 3}. I want to rank this vector but the ties must be replaced ...

15 30 50 per page