# All Questions

45 views

### How do I perform exact unit conversions with irrational conversion factors?

Suppose I want to express $3h$ in units of $\hbar$ (where $h$ and $\hbar$ are the Planck constant and reduced Planck constant, respectively). By definition, $h = 2\pi\hbar$, but when I attempt this ...
120 views

### Faster trimming of leading/trailing zeroes in rectangular array

Given a (large) rectangular array, e.g. (small for example case): ...
51 views

### How to make work Plus function? [duplicate]

I have a little problem. I have k = 1.56343*10^9; r = 9.10492*10^18. And I should receive a (2*r*r-k*k)/2*r*r, it equals to ...
60 views

### Use a Module to return multiple plots

A program I'm running requires me to generate multiple plots over the same domain, so I thought it would be fairly simple to use a module and bury all of the plot commands within that that way I only ...
160 views

### Nearest neighbor distribution

I need to construct nearest neighbor distribution for a given finite set of real numbers. I have no clue how this can be realized. Any suggestion would be very much appreciated.
41 views

### MousePosition and While loop Control, maybe Dynamic in While statement?

I would like to write a simple code that samples mouse position as frequently as the system can handle (with minimum dt) starting when the mouse position leaves a region and ending when the mouse ...
31 views

### Add Numbers to Notebook Cells

Let's save I have a notebook full of text cells. How might I add numbering to the text cells?
46 views

### Collecting specific Lists of data in coordinate form

Note: This might be trivial for many of the users but i am new to mathematica so i don't know!!! Question: Suppose i have three list of data as follows: ...
54 views

### Error with using NDSolve [duplicate]

I am currently trying to numerically solve a system of differential equations. Here is my code: ...
59 views

### How can I calculate the maximum number of grid layout possibilities?

I am doing some modelling where I am trying to randomly layout some points on a grid. What I know: How big the grid is The number of objects that have to be laid out on the grid, at a point The ...
48 views

### What is the correct idiom for mapping a 0 value in a modulo n expression back to n?

What is the correct idiom for mapping the $0$ value in a modulo $n$ expression back to $n$. For example if I want to be sure that any integer value maps back to the index for a character in the ...
43 views

### Can I redefine the ++ increment operator to make it behave like Haskell

In Haskell, joining two lists l1 and l2 is simply done with l1 ++ l2 In Mathematica ...
231 views

### Calculating average distance between maxima

I'm having trouble figuring out a way to analyze some simple data. When graphed, the data I have make a somewhat sinusoidal curve. What I want to do is to find the x-values of the maximum peaks of the ...
69 views

### Using Wolfram Library Reference in Excel VBA

Long time ago I did this question to MathGroup, but without success. In Excel VBA, in Tool/References, there is a option called "Wolfram Mathematica Control 8.0 Type Library" I belive that ...
51 views

### How to combine 2d and 3d plots with this code [duplicate]

I found a picture for example in google and I want to do with my code like that: And here is my code: ...
24 views

### ListContourPlot for 3D data [closed]

I have an n x 3 list of some solar cell data that looks like this. ...
36 views

### Integrating the second derivative of a 3D curve

I have a 3D curve K2[s_] := c1[s] + 0.4*(j[s]*Sin[500*Pi*s/97.8] - v[s]*Cos [500*Pi*s/97.8]) where j and v are frame vectors. I want to find the integral of ...
155 views

### How to access an already opened Excel file in Mathematica?

This post 4594 shows how to open a existent Excel file with Mathematica. And this 6686886 shows how to do what I need, but in C#. This 12282310 is another related one. How can I connect to a ...
33 views

### Is there a way to change the indentation behavior of the postfix operator //?

For example, using newlines after // results in some really weird indentation: Ideally, I'd love to be able to do something like this: ...
111 views

### Finding a formula for a 3D shape and colouring it

I created a wall with line command ...
155 views

### FindShortestTour to solve Traveling Salesman Problem

I'm trying to write my own code to find the shortest route but I'm lost on how or where to start. Does anyone have any idea how the FindShortestTour function works? What type of algorithm or structure ...
55 views

### Dataset Query using Composition fails but RightComposition works - why?

V10.1 on Win764 Enterprise. In this (CORRECTED) example the two Queries may be compounded into one using RightComposition sucessfully... ...
48 views

### Problem with greek!

I am using mathematica v10. I have two promblems. 1. I cannot open notebooks made from another version of mathematica(I open them and i cannot read the greek fonts in a cell which i have wrote) 2. ...
136 views

### why MeanFilter is nearly 100 times slower than MovingAverage for 1D array?

I used to average over my data with MeanFilter before I learn about MovingAverage and thought that these two functions are similar except that MeanFilter is more powerful for its ability to deal with ...
54 views

### Input text next to plot axes

Please see the following image showing my plot. I would like to indicate $\omega$ is maximized at $\bar{\omega}$. But as you can see, it is cut and does not appear correctly. Do you know how to fix ...
51 views

### NMaximize with constraints [closed]

I want to find a maximum of the following function: ...
26 views

### Boundary condition not correctly imposed for NDSolve

I notice that when plotting the below NDSolveValue ...
21 views

### EllipticK error message [closed]

I need help correcting this error message in Mathematica. ...
20 views

### How to use EllipticK in a plot and avoid getting the “not a machine-sized real number” error message? [closed]

k = Sin[π/2]; m = k^2 θ (τ) = 2 ArcSin[Sin (π/3).JacobiSN[x_, m] {τ - τ0, k}]; Plot[θ (τ_), {t, 0, 4 EllipticK[m]}] ...
670 views

### Finding the period of an array of integers

A simple array of integers is given. The problem is to detect if a pattern is repeatedly occurring in the array, and find the length of that pattern. For example, for ...
48 views

### Failing to solve a simple PDE with NDSolve

I'm trying to solve the following PDE. Actually this is a major simplification of the original with all x,z dependent coefficients being fixed. For some reason Mathematica (10.0) cannot solve even ...
80 views

### compute the gradient in high dimension

The following code is used to compute the gradient of a given 2D data. ...
95 views

### Collect distributed sums

I have another task that somehow should be trivial. Suppose I have the following expression $$\sum_{i=1}^n \frac{2}{9} x_i + 2 \sum_{i=1}^n \frac{1}{9} x_i,$$ or in Mathematica-FullForm ...
32 views

### Speeding up EPS exporting ?

I'm using Mathematica 10 to render some figures, and I'm noticing some strange behaviour with EPS figures. I'm making figures like the one below in EPS format. And to do so, I use some code like ...
95 views

### Plot with tick labels but without ticks

In scientific literature, plots often have a design like what I've been trying to make (see below). These images have the following characteristics: 1) Frames on the left and on the right 2) An x-axis ...
27 views

### What is the meaning of the lists of numbers in the FullForm of a compiled function?

For example, f = Compile[{{x, _Real}}, x]; FullForm[f] has this output: ...
24 views

### Deriving expression for the 'curve-in' condition in an equiangular (log/bernoulli spiral) [closed]

For any 2 pairs of points (xe,ye) & (xs,ys), I can fit various equiangular spiral through those 2 points based on the equation r = ke^(aθ). A typical one is illustrated below: Then, I can vary ...
29 views

### Roots of two Functions containing integrals, with two parameters [duplicate]

I want to find the values of l1 and l2 from the following two equations: ...
14 views

### How to show user-defined level set when using ListContourPlot3D [closed]

I want to display the level sets of a 3D point data.(e.g. data values equal 2 and 4 respectively) The provided examples of RegionFunction option for ...
79 views

### Solving coupled differential equations with an eigenvalue

I have 2 coupled differential equations with an eigenvalue Ei and want to solve them ...
47 views

### Perform operation on part of a table / create a reference

There is a function f that I would like to operate on a rectangular part of a table t. The part is specified by function ...
36 views

### Optional arguments with lists as function parameter

I'm developing a function to process 3D data volumes which is very similar to ImageTake and should support the same optional arguments. ...
43 views

### How to convert absolute time to local time?

I tried this code: ...
53 views

### How to export Time Series Data? [closed]

I can't simply convert it to a list Normal аnd to export. I tried many times. But not successfull.
81 views

### Can we say that “all functions in Mathematica are some kind of pattern-matching-and-replacement procedures”? [duplicate]

Currently I am studying Mathematica programming, and when I study pattern matching and replacement, I find it is quite similar to functions. So can we say "all functions in Mathematica are some kind ...
44 views

### Solve on parametric equation produces inequal results

I have a parametric (parameter t) equation in two dimensions (vectors). s = Solve[pt[t] == qt[t], {a, b}] Both pt and qt are parametric lines using a and b as ...
68 views

### Problem in matrix multiplication

I created a random directed acyclic graph using Mathematica. I need to compute a specific function from its adjacency matrix. ...
27 views

### Error Exporting STL --insufficient elements to export

I am trying to export the following code as an STL file: ...