4
votes
2answers
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 ...
5
votes
1answer
105 views

Recursion and safety of SetAttributes[Function, SequenceHold]

Compare the timings below ...
2
votes
1answer
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 ...
3
votes
1answer
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 $} ...
5
votes
2answers
220 views

Better method for creating a tuple out of two lists

I just combined two lists using this method ...
6
votes
2answers
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 ...
1
vote
2answers
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 ...
5
votes
2answers
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 ...
5
votes
3answers
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 ...
4
votes
1answer
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: ...
2
votes
1answer
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 ...
11
votes
1answer
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: ...
6
votes
1answer
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 ...
5
votes
3answers
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 ...
2
votes
2answers
309 views
8
votes
3answers
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 ...
3
votes
4answers
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 ...
11
votes
3answers
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 ...
8
votes
3answers
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 ...
1
vote
1answer
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: ...
0
votes
2answers
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 ...
1
vote
2answers
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, ...
5
votes
2answers
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 ...
4
votes
2answers
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 ...
2
votes
1answer
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 ...
7
votes
3answers
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 ...
2
votes
3answers
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 ...
8
votes
3answers
241 views

Applying a transformation rule on an Image

I haven't been able to figure out why the following doesn't work: ...
5
votes
1answer
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 ...
2
votes
2answers
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 ...
3
votes
1answer
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 ...
3
votes
4answers
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 ...
4
votes
3answers
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: ...
0
votes
1answer
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 ...
4
votes
1answer
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. ...
3
votes
1answer
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: ...
9
votes
1answer
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 ...
1
vote
1answer
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: ...
3
votes
3answers
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 ...
-1
votes
2answers
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. ...
4
votes
1answer
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 ...
5
votes
1answer
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 ...
1
vote
2answers
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 ...
3
votes
1answer
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: ...
1
vote
2answers
79 views
3
votes
3answers
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: ...
18
votes
4answers
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 ...
4
votes
1answer
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 ...
14
votes
2answers
296 views

Haiku Extractor

Inspired by the cool Tumblr Haiku Times that searches for accidental haiku in New York Times articles, I tried my hand at implementing such a search in Mathematica for my own text samples. I'm still ...
5
votes
2answers
264 views

How to capture Print output

How can I capture output from Print from a function which does not leave the printed object as its final output, (and which I do not wish to edit)? E.g. ...

15 30 50 per page