# All Questions

245 views

### Can Mathematica understand Excel dates when in number format?

I have a very large Excel file with dates in the format 2013/01/17 08:02:00 PM which is a custom date format. I have to convert this file to CSV in order to import it into Mathematica because I can't ...
105 views

### Recursion and safety of SetAttributes[Function, SequenceHold]

Compare the timings below ...
78 views

### Why the coloring in Block construct? [duplicate]

I want a function that works like in the following example: it gets an expression which contains a variable var and evaluate it setting setting var = value. I used ...
155 views

### How to replace variables in an expression?

I have generated a matrix using Mathematica, $\left( \begin{array}{ccc} \text{cos$\theta $} & -\text{sin$\theta $} & \text{cos$\theta $}\, \text{dx}+\text{dx}-\text{dy}\, \text{sin$\theta \$} ...
220 views

### Better method for creating a tuple out of two lists

I just combined two lists using this method ...
177 views

### Reduce data by taking averages

I am trying to implement the following: I have got two vectors x and y of unequal lengths. The length of ...
77 views

### How to construct a new list made from a function that operates on two lists

I need to take two lists (each list contains the number of moles of a chemical). I have a function calledFraction that takes the each entry of the list and then calculates the mole fraction of ...
169 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 ...
406 views

### Order list of monomials by degree (Pascal's Triangle)

Suppose I have the following list of monomials: {1,x,x^2,y,y^2,x*y,x^2*y,x*y^2,x^2*y^2} How could I manipulate it to get ...
146 views

### Padding plot ticks with zeros on the right

I would like to know how can I make a real-valued plot tick pad with a zero to the right of the decimal point on integer values. This is what I have: ...
78 views

### Change “Format type of new input cells” to InputForm

In Preferences -> Evaluation there is a menu to change "Format type of new input cells" and the only options available are: StandardForm, TraditionalForm, and Raw InputForm. Is it possible to set ...
158 views

### MakeJavaObject on list of inhomogeneous objects belonging to the same base class

When using J/Link, how can we create an array out of objects belonging to different classes but having the same base class? Here's an example: ...
122 views

### Using enum values with J/Link

How can I pass enum values to a function when using J/Link? What is the correct syntax for typing an enum value? For example, call normalize() using ...
224 views

### Multiply list of pure functions by list of scalars?

I am trying to write a function that returns a list of pure functions. The last step in the function, is to multiply the list of pure functions by a list of scalars (i.e. matrix multiplication). When ...
309 views

The function ...
2k views

### Simplify expressions with Log

How can I get Mathematica to simplify the following expression n Log[a] + m Log[b] - m Log[a + b] - n Log[a + b] into ...
249 views

### Find components which have intersections with designated lines

I have an image with several disconnected components, and I want to find all the components which have intersections with some designated lines which I generated previously. The image: And the line ...
377 views

### Custom functions by delegating options in a specific way and using core functions

I'd like to create a custom function that does essentially the same as a core function of mathematica but uses different default settings. Example: I want a Plot function that uses Mathematica's core ...
193 views

### Functions that creates symbol in a specific context

I'm trying to make a function f that takes a symbol, a value, and a context, and creates the symbol in the requested context and assigns it the passed value. The ...
515 views

### Use Results from Manipulate Plot NDSolve to create another plot versus variable used in DE

I created my plot using using this input: ...
291 views

### Importing base-64 encoded Canvas element into Mathematica

The aim of this code is to transfer a web image into webMathematica for image manipulation. Since the question here failed to resolve direct URL loading, I tried a different method of extraction ...
250 views

### List of numbers without common factors with a certain number

Is there any function in Mathematica which directly gives an array of integer numbers with no common factor with a certain integer number? For example, all the integer numbers between 0 and 1728, ...
392 views

### How to convert data types in a LibraryLink wrapper

I have a dynamic library which I want to load into Mathematica using LibraryLink. I don't have access to the source code of the library, so I need a C wrapper to do the job. In the C wrapper, I would ...
87 views

### Creating functions from output of other calculations

Apologies in advance if the title is vague, I'm not really sure what to call this. I have a function (call it 'foo') that generates a largeish polynomial, and it is natural to make the variables be ...
106 views

### InterpolatingFunction with growing Domain

I want to find roots of a function that is very slow to calculate (the function itself involves a bunch of FindMaxima) so I interpolate the function in a region where I think it likely the the root ...
281 views

### Unencoding encoded URLs in a function

Is there a built-in function for decoding encoded URLs in Mathematica? I would like to convert an encoded URL, for example ...
106 views

### BarChart without axes neglects the last zero of a list

Creating a BarChart with {1, 2, 3, 0} as BarChart[{1, 2, 3, 0}, Axes -> False, Frame -> True] gives me only the first three bars, a chart identical to just ...
241 views

### Applying a transformation rule on an Image

I haven't been able to figure out why the following doesn't work: ...
137 views

### Is it possible to lower the bitwidth of (floating point) numbers?

The answer to this question will most probably be a definite no. Nevertheless, I would like to know whether it is possible to represent reals in the memory on less than the standard 32 or 64 bits ...
1k views

### How can I change the position of my plot legends?

As the title indicates, I want to change the current position of the legends in a combined plot. The Mathematica code I used is ...
130 views

### Can one optimize AutomaticNumbering feature?

If one wants to use the automatic numbering feature of Mathematica, he has to make tags for cells of the type he wants to be referenced to. Then, as soon as he needs to make a reference to the tagged ...
218 views

### Descriptive statistics of two events

I am trying to use the descriptive statistics feature of Mathematica to answer the following question: suppose I have two events, A and B, whose occurrence is described by a normal distribution around ...
402 views

### Prevent Mathematica to automatically evaluate Manipulate at start

I'm using an initialization cell to import a lot of data: data = Import[myFiles]; and then I use a custom function to display this data with Manipulate: ...
219 views

### Why don't I see all the grid lines in my combined contour plots?

I am trying to display four continuous functions, but when I try to combine them withe a single Show, I can't see the second vertical line. I suppose the problem is ...
961 views

### Is it possible to impose “Assumptions” in DSolve or equivalent? (differential equation solving)

When DSolve tries to solve differential equations, it is sometimes not smart enough to generate conditions according to different possible value of parameters. ...
129 views

### NetLink Exporting Images doesn't work (Unknown string escape)

Exporting Image files (intermittently) doesn't work: I get messages back indicating the error is to do with escaping characters: ...
796 views

### Search the neighborhood area along a line in an image

I am trying to search for the black areas along a line (the horizontal line shown below). Though it is straight in this picture, it could be of irregular shape in other cases. It seems that the ...
138 views

### How can one type a box with “x” marked?

In some text portion of my notebook, I would like to be write check boxes which are empty, check marked or "x" marked. The following commands work for the first two: ...
191 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 ...
472 views

### Convenient methods to sum select rows (or cols) of a matrix? [duplicate]

What are some convenient methods to sum selected rows or columns in a matrix? This question Summing along rows or columns of a matrix only addresses how to sun entire rows or columns ie, by level. ...
209 views

### Is it possible to create a compiled function with some symbolic arguments?

I am trying to create a compiled function that takes in several arguments. However, some of the arguments contain symbolic entries and thus I get the following error message when executing the cell ...
168 views

### Trouble with Flatten[]

I made this function: f[g_] := Table[{ToExpression[ToString[x] <> ToString[n]], 1, 3}, {n, 1, g}] When I evaluate the function with some g (say 8), I'll ...
228 views

### How to blend some colors on a curve

I need to define a color gradient on a 3D curve, but I'm having some problems with this. Suppose we have a 3D curve defined as a parametric function of some real variable ...
204 views

### Autocomplete short symbol names in non-global context

Is it possible in v9 to autocomplete the short symbol names when one is operating in a context other than Global`? I.e. after evaluating the following: ...
79 views

...
3k views

### Label points in plot with a text

I'm a newbie at Mathematica and I couldn't find how to label the maximum and the zero of a simple function in Plot with their names: ...
605 views

### Accessing list elements by name

First, a bit of a long introduction to my problem: I only have a few weeks of Mathematica experience. I am creating a mathematica application that calculates some material properties of steel based ...
250 views

### Plot an undefined function

When I plotted an undefined function, Mathematica also spends considerable time to process it. It returns a blank figure necessarily. What confuses me is where the ...