# All Questions

130 views

### Issue with scope of variables

For the definitions, t = 1; f[x_, y_] := t (x + y); v[3] := {1, 1}; g[u_] := f[v[u][[1]], v[u][[2]]]; the following two expressions yield different results, ...
213 views

### RecurrenceTable with a recurrence function of two variables

I have to calculate the cool down process of a regenerative heat exchanger. I solved the problem in Excel before, but now I want to do it with Mathematica. I want to create a table with the variables ...
189 views

### StringReplace except some pattern

StringReplace and search out of one pattern ...
150 views

### Little problem with Through

list = Partition[Range[20], 5, 5, 1, {}] {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}} ...
119 views

### What is the fastest way to get a list of subexpressions and their positions?

I have spent quite some time trying to figure out what the fastest way is to get a list lists of all subexpressions and their positions. I have tried things with MapIndexed, which seems ideal in cases ...
132 views

### Different Chapters in Different Files

I was wondering if there is a command to change the counter to adjust its numbeing to having different chapters saved as separate files. This seems possible with page numbers but not section numbers.
103 views

### Does resizing plots produce new data? [duplicate]

What I do: ListPlot, Select the plot area, A tooltip says: Double-click to edit, Double-click the line or a point on the line, Take a handle to resize the red ...
126 views

### Resampling when using image as Texture

How to get sharp pixel boundaries with Texture? I'd like to have only black/white in the example below, no gray. ...
122 views

### I am missing a function like HoldPattern

Temporary message: I am planning to edit this question, making the examples less confusing and by moving the things that are confusing to a separate question For any confusion about expressions that ...
185 views

### Create a table with inline conditions

I am trying to create a table with conditionals inline. For example, I'd like to create a 2 dimensional table like this: ...
150 views

### Replace elements in a list

Suppose that I have a list: ...
234 views

### Solving recursion relations using Mathematica

I want to solve the recursion relation given in equation 2.7(a/b) on page $6$ of this paper. (..the initial seed is $F_1 = G_1 = 1$ and the functions $\alpha$ and $\beta$ are defined on page $5$ in ...
104 views

### How to set PlotLegend Number Format

Is there any way to make Mathematica to show the legend labels like a real number rather than in fraction form? I read the BarLegend options, however they are just ...
168 views

### Alternative to using global variables in functions?

Often times I find myself using unevaluated variables (i.e. they show up blue) as dummy variables in whatever I'm returning such that I can evaluate them as needed later on. A simple example is as ...
240 views

### Combining two plots which are in two regions

I want to combine two plots which are in two regions. For an example, I want to plot following two figures in the same plot. ...
203 views

### Find the a factor of an integer which is nearest to another integer

If I know two integers $n$ and $m$ and $m < n$, how can I find two different integers $x$ and $y$ that are nearest to $m$, and satisfy Mod[n,x]==Mod[n,y]==0 ? ...
86 views

### How does MakeBoxes handle an n-ary operator?

I want to format results from Reduce using the $\cup$ symbol instead of the $\lor$ symbol. For example, ...
264 views

### How can I fill a wire-frame structure with gas in a Graphics3D drawing?

I am very poor at visualization. I want to make a transparent "building" filled with gas. I wrote the following code for the building and it's fine. ...
103 views

When considering this question about re-formatting Cell (also this one), I encountered an issue which confuses me. I'll let the code itself speak: Consider the ...
3k views

### How to plot an ellipse?

I'm new to Mathematica, and I'm finding it difficult to plot an ellipse. I tried using Plot[(x/5)^2 + (y/3)^2 == 1, {x, -5, 5}, {y, -3, 3}] but I'm getting ...
352 views

### Insert a 2D graph in a 3D graph

I have this question: Suppose I have some two dimsensional graphic element, say "flower" (i.e. a picture of a flower) in a Mathematica notebook. I want to insert this figure, say at a specific ...
156 views

### Efficient way of setting up a rule

I tried to define a simple rule defining how λ acts on ψ[n]: myrule1 = λ ψ[n_] -> α[n + 1] ψ[n + 1]; The result I get is ...
101 views

### UpValues evaluation with Dot operator

I would like to simplify some database notation, and I'm doing some tests with UpValues for that. For example, if I set this Upvalue fot tab1: ...
121 views

I have created a grid, and also made a list of control objects(ex:inputfields, buttons, etc..). Then, I lay the list in my grid. There is no problem. However, the final layout takes a lot of time. I ...
278 views

### Dynamic matrix multiplication

I have the following problem: I want to multiply two matrices and sum them to another matrix C. A.B+ 2B Easy! The matrix A varies as a function of three inputs a,b and c. The second matrix, B, is a ...
221 views

### Problem with dynamic MouseAppearance updating while “MouseDown”

my problem is with combining EventHandler and MouseAppearance. I want to change cursor appearance if I have primary button ...
1k views

### How can I solve this PDE with initial conditions?

I wish to solve the following second order partial differential equation $$u_{tt}=c^2 u_{xx}$$ with the initial conditions $$u(x,0)=e^x,\quad u_t(x,0)=\sin x$$ In Mathematica, I evaluated the ...
151 views

...
261 views

### How to find Image Size of a control object?

I want to find the ImageSize or at least dimensions of any control object irrespective of it being an image or an any other control such as ...
232 views

### Display function value on hover?

I have used Manipulate in conjunction with Plot to draw a function's graph and I would like to show the current x-axis value and function value while hovering over the function's plot. How can I ...
239 views

### Show does not combine the plots

i've the following problem: because it's not possible to plot complex numbers (or is it?) i created my own "function": ...
90 views

### Pattern matching not going over a list when using default values

if I execute the following command in Mathematica: {a,a^2,a^3}/.a^(n_:1)->b^(2 n) Mathematica returns: {b^2,b^4,b^6} ...
327 views

### FrameTicks and GridLines in DateListPlot

I would like to know what is the best way to configure one GridLine for the hour in LightGray and another for the days in ...
304 views

### How to insert a link to a generic file, in the middle of a text style cell/paragraph?

It is easy to insert a Hyperlink to a notebook file, or to an internet address, in the middle of a text style cell (Ctrl+Shift+H or menu: Insert->hyperlink). Trying to create a hyperlink to a file ...
485 views

### Solving Integrals

Here's a problem that I don't understand. f[x_] := Exp[Cos[3*x]] g[x_] := (1/3)*x^3 - x^2 + 2 When I try to find the limit: ...
150 views

### Button doesn't evaluate variable containing Module

I have a huge set of code to accomplish a data transformation. I have saved this set of code as eg: ...
270 views

### a problem about simplifing conjugate

the situation is as follows ...
254 views

### Exporting/Importing a Table of complex numbers

I'm generating a long table of list of the form: PN={{1,2,1+i},{3.5,2.6,2}...},{...},... Using: Export["PN.dat", PN, "Table"] ...
383 views

### Fast Trial Division

I'm going to write a custom Trial Division primality test. I know that PrimeQ will first try trial division and then switches to ...
104 views

### How to grab CellTags from a Cell?

I am in the process of creating a palette for a specialised "Save as HTML". For context please see this. How can I grab the CellTags from a Cell[...] object? This is my first iteration, aka testing ...
101 views

### Dealing with errors and resuming the code after one

How can I write my Mathematica code so that it resumes at a specific place if any Message is displayed during the execution of an expression? For example, in Visual ...
298 views

### How to export multiple Barcharts from Mathematica to $\LaTeX$

I have to make a document with multiple bar charts and export it: ...
167 views

### SetAccuracy behavior

I'm puzzled by the output I get from SetAccuracy. According to the documentation, when SetAccuracy is used to increase the ...
264 views

### How to pull scalars out of a function that should act on lists?

Suppose I have A = a vecA B = b vecB where a and b are supposed to be arbitrary scalars ...
394 views

### Add two Histograms to calculate summed Mean and StandardDeviation

As a follow up to this question: Calculate mean and standard deviation from ImageHistogram I would like to add two histograms before calculating the mean and StDev. I would like to sum the numbers, ...
855 views

### Finding the Minimum value of an interpolating function

I can't seem to use FindMinValue to find the min. value of a curve represented by an interpolating function. For instance the below code generates an interpolating ...
518 views

### can mathematica plot graph/visualize rotation matrices

just wondering is there any example online that show plotting of 3d rotation matrices like in the picture below (source)
392 views

### Don't simplify an expression

I have an expression that I want Mathematica to fully expand without any simplification afterwards. I want the output to look like the following example. ...