# All Questions

998 views

### Sort strings by natural ordering

Is there an easy way to sort strings according to their natural ordering? For example a list of file names ...
237 views

### How to move differentation before the integral?

I have quite a lot expressions that need to be integrated after switching the integral sign with differentiation operator. The additional problem is that the bounds are dependent to one of the ...
1k views

### Finding eigenvalues of a $1500\times1500$ matrix

I need to find the eigenvalues of a $1500\times1500$ real symmetric matrix given by $A_{i,i+1}= A_{i+1,i}=-1$ and also $A_{1,N=1500}=-1$ (this is because of a periodic boundary condition used) and all ...
126 views

### How to prevent substitution?

I have a function: $\bar{u}:=u[t,x,y,z]$ (1) How do I prevent it from expanding and substituting in instructions like those following: $\partial _t {\bar u}$ (2) Thanks in advance EDIT: ...
1k views

### How are parameters evaluated for a Plot in Manipulate

I am trying to get my head around how Manipulate evaluates functions in a Plot. I have read the introduction to Manipulate, and introduction to Dynamic, but I still ...
418 views

### Piecewise function with a function as argument

I want to define a piecewise function, which has two arguments, one of which is a function of the other's piecewise argument. I am giving an example ...
160 views

### How can define a set of nested parameters

I would like to know how I to define a function with a nested set of parameters (or whatever you would like to call it). For example, how would I get the following function ...
4k views

### How can I plot the complex graph of $x^x$ in Mathematica?

For example, this Wolfram Alpha query shows this graph: But it does not show the code for plotting it in Mathematica. Plot[x^x, {x, -1, 1}] only plots the real ...
659 views

### Using previous two solutions as a start point in FindRoot

I need to solve a sequence of equations and I want the starting point of each new FindRoot to be the solution of the earlier FindRoot, increased or decreased by a a bit in the following way: Some ...
179 views

### Is there a convenient/automatic way of uploading a notebook into SE?

This post discusses how to streamline the other way - extracting code from a fragmented and longish SE answer but I imagine a two-way workflow like: Fashion an answer/question in an SE-templated ...
575 views

### How to fit one distribution to another?

I have a custom distribution created to model some experimental observations. While too complicated to include in this question, I can provide an example and some illustrations to convey a sense of ...
4k views

### How to get Matlab data imported with the same dimensions?

I have some Matlab image data with the following dimensions (output is from Matlab): >> size(im) ans = 86 86 3 45 The data imports just fine ...
294 views

### How to output an expression as a Dot[] product

How to force Mathematica to output an expression such as $a1u1+a2u2+a3u3$ as a Dot product like this one: ...
725 views

### How to plot rectangles aligned by their center?

Supose I have a rectangle which area is $x^2$. In some cases I may not know what is the size of each side, for $x=12,$ we have several possibilites: ...
2k views

### Finding the number of solutions to a diophantine equation

I want to count total number of the natural solutions (different from 0) of the equation $2x + 3y + z = 100$, but don't know how. How can I calculate it using Mathematica? I tried: ...
3k views

### How to convert equation to vector (matrix) form?

How can I convert expression a1*u1+a2*u2+a3*u3 to the vector form of dot product A.U, where ...
616 views

### Clustering a bivariate data set with Mathematica

I need to partition a bivariate data set into predetermined "n" clusters and, at the same time, to fix the centroid position of each cluster. Is the ...
511 views

### Count sublists which match pattern

I have a list which looks like this: data={{12,0},{0,0},{20,1},{0,0}, {0,-1}}. Now I would like to count the number of sublists which: have both slots zero the ...
583 views

### Rotated text in “plot” cannot be copied to MS Word

When I add some text to a simple plot with drawing tools, the text cannot be copied and pasted out with the graphic itself to Microsoft Word. Do you know how to copy the manually added text out to ...
493 views

### Problem in RegionPlot3D

I tried to plot the region bounded by the three planes. This is supposed to give me a pyramid type of shape (actually two, but I am just taking one of them). The code is given by ...
733 views

### Plot 3D vector that is a function of one variable

I have a function, r[t], which is a piecewise function that generates a 3D vector. It looks like this: ...
573 views

### Problems with FindMinimum for Constrained Optimization

I am trying to define a simple optimization problem, arising from the discretization of a simple Optimal Control problem. The problem that results is essentially linear, with bilinearities only ...
187 views

### How can I build an inline documentation utility?

I often have a large function to which I add inline comments, but then I can't see the forest for the trees. How can I make a tool that extracts the comments and tokens within them to generate an ...
3k views

### Nested NIntegrate

Suppose that we have the given simple integral expression $$\int_{-5}^{5} x \int_{-\infty}^{x} e^{\int_{0}^{z} -y dy} dz dx$$ Writing this out in Mathematica we obtain: ...
301 views

### Docked Cell lesson chooser

I have a question about creating a docked cell that will let me choose files. This is just as much a "design" question as a Mathematica question. I'm a math teacher and I want to bundle a bunch of ...
157 views

### How to arrange elements of a list

A file consists out of (x,y,z) data and I need the z-values arranged like this: {{z[1],z[2],...z[idimx]},{z[idimx+1],z[idimx+2],...z[idimx*2]},{....}} With ...
3k views

### Best way to extract values from a list of rules?

Mathematica has a lot of list manipulation functions, and, also because I don't work with lists often, at times I'm a bit lost. I'll find a way, but I'm sure it's not the most efficient. Case in ...
1k views

### Is it possible to typeset left and right angle brackets?

I would like to typeset the following in a Mathematica notebook: $$\langle P \rangle$$ Is it possible to typeset left and right angle brackets? In $\LaTeX$, they are given by ...
2k views

### What is the best way to create a correlation matrix heatmap with values?

This may have been asked somewhere else, but I couldn't find an answer by searching. I'm trying to create a correlation table that colors the background behind the numbers as a heatmap. I've been ...
2k views

### Fourier Transform of a Step Function

I'm trying to obtain the form of a sinc function that I know I'm supposed to get in Mathematica. I'm doing this because I intend to do a lot with Fourier transforms (FT) and I'd like to know I'm not ...
98 views

### Retain values between sessions [duplicate]

This is a real newbie question, so apologies in advance for may seem a very dumb question ... I'm trying to understand the various ways in which information can be retained in a notebook between ...
1k views

### Variables Inside Functions Not Evaluating

x = 5*y function1[y_] := x function1[5] Am I wrong in thinking that function1[5] should equal 25? Instead this comes out. ...
685 views

### Using Goto and Label in compiled function?

Below I post some rudimentary code to show that there is something wrong using Goto and Label commands in compiled functions (or I believe there is something wrong). It seems that the command Label is ...
432 views

### How to change specific values in a List [duplicate]

In a list lst I want to change all values > 255 to 255. Why is this code not working? ...
1k views

### discrete Fourier transform

As an answer to my code I will get a periodic discrete time dependent function called "data" which I want to get a Discrete Fourier transform of it using just one period of it,but I think some thing ...
671 views

### Poor results with ImageLines function

I'm trying to get my mind wrapped around Mathematica's image feature recognition functions. I'm intrigued by the ImageLines function for a couple future ideas I ...
11k views

### Marking points of intersection between two curves

I'm trying to illustrate the solutions numerically and graphically for an equation such as Tan[x] == x. I think I did everything ok except I wanted to mark each ...
344 views

### Mathematica list element sort

I have a list, say, ...
88 views

### Graphics[] not working from within For[]

Why is the following code not plotting the set of points from {1,1} to {10,10} ? For[i = 1, i <= 10, i++, Graphics[Point[{i, i}]]]
2k views

### Fitting a spline to data with FindFit?

I am trying to find a function that fits my almost linear data. A high order polynomial model has too much residual. So I was hoping to use Mathematica to fit splines to the curve. This is what I ...
625 views

### Single-Window-UI not possible? [duplicate]

I'm still very frustrated about the separation of the menubar (File, Edit, Insert, ...) and the open notebooks in different windows. I would prefer to have the menubar directly above each notebook in ...
3k views

### How to plot empty rectangle?

I know there is a Rectangle[] function, but it is always filled with some color. What I need is a rectangle, which is empty inside (only it's boundaries visible). I ...
2k views

### How to tell Mathematica that a function is dependent on other variables?

I am trying to derive some turbulence model dependencies and I am using Reynolds averaged Navier-Stokes equations. What I am trying to do is to tell Mathematica that OverBar[u] is dependent on x,y,z ...
133 views