7
votes
1answer
181 views

Returning a value from a Module

In the following simple example MyMod := Module[{i}, Do[ Return[1], {i, 3} ]; Print["test"] ] I expected the module to exit on ...
7
votes
2answers
246 views

Is there a function which instantly tells you whether an element is part of a list?

I have a very long list of numbers and I want to check whether there's a function (something that would look like PartOfQ[element,list]) that tells you immediately ...
7
votes
1answer
108 views

How to understand shared passing of a MTensor in LibraryLink?

According to the documentation, there are four different type of memory managing when passing a MTensor with LibraryLink: Automatic, "Constant", "Manual" and "Shared". The Automatic and "Manual" is ...
7
votes
0answers
121 views

Highlighting Mathematica code in LaTeX document

I was thinking about the best way to include Mathematica code in a LaTeX document with a nice syntax highlighting. I have tried the packages listings and minted (with pygments), which both claim to ...
7
votes
2answers
177 views

Working with Java hashmaps from Mathematica

I'm using J/Link to access data from an external Java program. The data are represented as a ConcurrentHashMap (see the official specification here). ...
7
votes
2answers
142 views

Behavior of Reduce with variables as domain

When using Reduce, I accidentally put a set of variables as the domain. To my surprise, it not only seems that Reduce expects ...
7
votes
2answers
288 views

Find asymptotics of Sum[2^i*Binomial[n-i-1,2*n/3-1],{i,0,n/3}]

I have an expression 2^n / Sum[ 2^i Binomial[ n - i - 1, 2n/3 - 1], { i, 0, n/3}] ...
7
votes
1answer
274 views

Find a word's linguistic pronunciation

Is there a way to get a word's linguistic pronunciation given the word as a string? I would like a function LingusticPronunciation such that, for example, ...
7
votes
5answers
948 views

Filling between parametric plots

I am new with Mathematica, but am trying to fill an area between two parametric plots ...
7
votes
0answers
167 views

Improving the performance of a package for working with rational functions

As Mathematica gets slow for large symbolic calculations, the cost of putting terms over a common denominator (Together), in particular, gets too high. It occurred ...
7
votes
1answer
152 views

The Flat Attribute, Unevaluated and the Evaluation Process

To make this question easy to follow let's give some symbols a couple attributes. Attributes[f] = {Flat}; Attributes[s] = {Orderless}; Now consider the ...
7
votes
3answers
317 views

Find names of the functions defined in a file

Lets say I have a file named file.m that contains: test[] := ( Print["test"] ) How would I go about extracting the function ...
7
votes
2answers
292 views

Convert Graph to Graphics

In Mathematica 9, a graph is returned as an object with head Graph: In[8]:= CompleteGraph[8] // Head Out[8]= Graph ...
7
votes
3answers
409 views

Combining Image3D and Graphics3D

I want to combine an Image3D and a Graphics3D using Show. Here is the code: ...
7
votes
3answers
278 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 ...
7
votes
4answers
213 views

Why does array packing in Table behave like this?

Consider the following example, which generate two identical arrays. Why sometimes the array is packed and sometimes it doesn't? And why they perform differently? Here the arrays are packed: ...
7
votes
2answers
415 views

How to generate a matrix group?

I have three $7\times 7$ matrices (with real entries, lots of zeros) and I'd like to check if they generate a finite group (or, more precisely, if the group they generate is of precise order). Would ...
7
votes
2answers
672 views

How to change an expression to Fortran90 form?

I have a large expression produced by Mathematica. To use this expression in my Fortran program I need to change it to a Fortran90 form. I am not satisfied with the ...
7
votes
1answer
287 views

How to change brackets in TraditionalForm output

I'm trying to improve TraditionalForm's output by using different brackets when there are more than one. For instance, instead of $u(v(r(b))))$, I'd like to get ...
7
votes
2answers
364 views

BoxWhiskerChart with logarithmic axes

I would like to make a following chart Ideally I would also like to control the boxes position on a logarithmic x-axis. Some inspiration how to do the latter may be found in the answer to my ...
7
votes
1answer
810 views

Dynamic Graph visualization

I'm working on a C++ library that will be used to construct and study certain graphs (as in a set of connected vertices, not a function plot). These graphs will be dynamic in nature (and can ...
7
votes
4answers
346 views

How to remove ticks?

I wanted to remove the Ticks in my coding but i can't. Here when i try to remove the Ticks the number also gone. I need numbers ...
7
votes
3answers
410 views

How to Gather a list with some elements considered unique

I have a list of the form: list={{0,...},{1,...},{1,...},{0,...},{3,...},{3,...},{0,...},{0,...},{5,...},{5,...},{5,...},{0,...},{5,...},{0,...},...} So when we ...
7
votes
1answer
248 views

How to wrap this dynamic code inside a Manipulate?

My goal is to set up a Ising-type simulation, where many fast simulation steps are done in the background, and a visualization of the current state is displayed as the simulation evolves, being ...
7
votes
1answer
173 views

Is this a good way to assign a Solve result to a function?

My code: ...
7
votes
3answers
651 views

How to rotate TickMarks in DateListPlot?

Is there a way to rotate TickMarks in DateListPlot to avoid overlap, eg: Part of the code used to generate this is: ...
7
votes
2answers
551 views

Simplifying the derivative of $|x|$

Context In[855]:= D[Abs[x], x] /. x -> 1 Out[855]= Derivative[1][Abs][1] In[856]:= D[x, x] /. x -> 1 Out[856]= 1 Question Why is ...
7
votes
6answers
601 views

Using a built-in symbol as a variable

I want to produce a Mathematica Computable Document in which N appears as a variable in my formulae. But N is a reserved word in ...
7
votes
2answers
2k views

Inverse of a complicated function

Mathematica is struggling to find the inverse of this function f(r): ...
7
votes
1answer
739 views

How to find the smallest root

I have a continuous, differentiable, monotonic, bounded function called F[t]. If t -> Infinity then ...
7
votes
1answer
568 views

Efficiently deleting rows in many large text files

I have 500 text files each of about 200000 rows. I need to delete one row in each of them as fast as possible (later such operations will repeat). What is the best way to do this with Mathematica? ...
7
votes
4answers
1k views

Force function to make assumptions about its input variables in Mathematica

I'm trying to force a Mathematica function to make an assumption about its input variables. In my case, I'm trying to define a function to return the pdf of a Gaussian. But let's use a simple toy ...
7
votes
1answer
144 views

Organizing similar datasets using Contexts or otherwise

I often import several long time series to analyze something about a city. When I have multiple cities, I use contexts. As a simple example, ...
7
votes
3answers
216 views

How to turn a set of strings which represent a list into a 2D list

I have a set of data read in from a larger CSV file. I want it to match the format I have from another analysis. It is structured as a series of strings with letters and numbers Here it is copy-pasted ...
7
votes
3answers
639 views

Efficient image Import

I have several sets of 20 images I need to import. Each time they have different categories. "Name"<>"Cat"<>"No" Electric B 1 for example. I need to create lists that contain the images ...
7
votes
1answer
847 views

How do you get high resolution plots in applications using the Mathematica MathService?

This is for Mac users only using MathService (MathService it seems, given that it was created back in 2004, is a power pc code and requires Rosetta to run on Intel). If I type a plot command in ...
6
votes
3answers
284 views

Does Mathematica have Month Range and Day range?

It is known that CharacterRange["a", "z"] gives list of characters from a to z. Does Mathematica have something similar for weekdays and months of the year? ...
6
votes
1answer
107 views

Can't plot rotated region

I was experimenting with the code from this question when I ran into another problem with regions. ...
6
votes
2answers
137 views

“The function DiscretizeGraphics is not implemented for GraphicsComplex” confusion

Why does DiscretizeGraphics seems to work on one GraphicsComplex and not the other? Here is an example that works: ...
6
votes
2answers
262 views

How to color edges of a graph which has multiple edges connecting certain vertices

I'm studying BIBD(Balanced Incomplete Block Design) and want to draw some graphs by coloring their blocks in different colors, respectively. A block is a collection of edges (or vertices). For ...
6
votes
4answers
503 views

How to find all data points within closed curve

I want to find all data points inside curve as given below: ...
6
votes
1answer
351 views

Find the eigenvector associated with the smallest eigenvalue, not smallest in magnitude

I am trying to find the eigenvector of a $20000 \times 20000$ sparse matrix associated with the smallest eigenvalue. I realized that the smallest eigenvalue might be negative; for example, if the ...
6
votes
3answers
462 views

How to randomly erode a 3D distribution of points with Mma 7.0?

Suppose we have a 3D distribution of points, like the spherical ball example below : ...
6
votes
1answer
76 views

Is it possible to find a function from first few terms in the expansion

Is it possible to find a function if first few terms of the expansion is known. For example if I have this series $f(x)=\frac{k^3 x^2}{6}-\frac{k^5 x^4}{120}+\frac{k^7 x^6}{5040}-\frac{k^9 ...
6
votes
1answer
296 views

Having trouble fitting data using NonlinearModelFit

I'm trying to fit data = {{2002, 45000}, {2004, 90000}, {2005, 120000}, {2013, 211000}}; to an exponential function ...
6
votes
9answers
524 views

combining and comparing lists

I have 2 lists (of lists), where most of the contained lists match. That is, the lists contained in list1 mostly match the lists contained in list2. In this simplified example each of the inner ...
6
votes
4answers
655 views

Removing empty sets from lists

If I had a list, say, names= {"Andy", "Bob", "Carly", "Sandy", "Jeff", "Tim", "Tom", "Zach"} and I decide to pick a characteristic only a certain of them have, ...
6
votes
1answer
154 views

The third argument of the Root function

Consider the roots of an arbitrary indecomposable polynomial: sol = Solve[x^5 + 2 x + 1 == 0, x] The returned expression is ...
6
votes
1answer
377 views

Getting clearer StreamPlot output

When I do a StreamPlotof a rather complicated pair of differential equations, it loses some details. For example: ...
6
votes
1answer
180 views

Behavior of Graphics`Mesh`InPolygonQ with self-intersecting polygons

Playing around with some of the answers in the question How to check if a 2D point is in a polygon? I noticed that: Graphics`Mesh`InPolygonQ[poly,pt] Displays ...

15 30 50 per page