10
votes
6answers
594 views

The longest run of at most k different elements in a list

I have a long list with ca. 500K elements. The list contains about 10K different elements. For simplicity let’s assume the list is of the following form: ...
1
vote
0answers
245 views

Can GPU (CUDA) speed up LinearSolve?

Is there a way to use GPU (CUDA) to speed up LinearSolve?
2
votes
1answer
293 views

Distinguishing left from right adjacent triangles in triangle mesh [closed]

What I'm trying to do: I'm trying to create a path-drawing function which will produce a path like the one I-P in the diagram below. The way this path was generated requires me to swap between the ...
1
vote
2answers
613 views

Extracting intensity from an image

Suppose I have an image sampleOriginal = Import["...mySample.png"] I then convert it to Grayscale colorspace ...
0
votes
1answer
149 views

LinearModelFit - Number of unique basis functions & Invalid variable errors

I'm having trouble with a simple linear fit model. Here is my code ...
4
votes
2answers
3k views

How to calculate extremely large exponential

I would like to calculate the following nested exponential: $$ \Large{e^{e^{10^{72}}}} $$ In case that might be hard to read, in Mathematica functional notation it is: ...
6
votes
2answers
199 views

How can you resize all the images in a notebook section?

I've pasted a large number of photos and they are too big which makes scrolling hard. Is there a way to automatically have Mathematica size them to 10% or something reasonable without have to click on ...
10
votes
1answer
1k views

How to train a convolutional neural net on images?

The functions Predict[] and Classify[] both have the option Method -> "NeuralNetwork", ...
4
votes
2answers
275 views

Explicit digit-count (precision) of real number

I'm trying to do something which seems like it should be simpler than it is (at least in my attempts at it). I have some code where I read in a list of numbers generated for me by a coworker. These ...
3
votes
1answer
68 views

AdjacencyList of DirectedEdges in Graph ignore edge direction

I have a simple tree graph with directed edges: In: AdjacencyList[Graph[{a -> b, a -> c, b -> d, b -> e}], b] Out: {a, d, e} I wonder how I can ...
5
votes
1answer
191 views

How to understand the difference between Sqrt and Log after ClearAll them

I came across this post, here I change the last line of the code Unprotect[Sqrt]; Sqrt[x_] = "blahblah"; Protect[Sqrt]; Sqrt[2] "blahblah" ...
0
votes
1answer
70 views

Plot of the set complex numbers [duplicate]

I want to show this set (eigenvalues of my matrix): ...
1
vote
0answers
162 views

ListPlot3D keeps crashing

I have some data, and I want to plot it by ListPlot3D: ...
0
votes
0answers
31 views

'MatrixForm' problem [duplicate]

I prefer to use 'MatrixForm' because the form looks better in matrix manipulation. But my current problem is that after the use of 'MatrixForm', subsequent matrix calculations like 'Det' or 'Inverse' ...
3
votes
1answer
166 views

Calculate efficiently an expensive hermitian matrix

I want to compute a matrix $M_{pq}$, for which the calculation of each coefficients $M_{pq} = f(p,q)$ is an expensive function. I know that my matrix is hermitian, so that $M_{qp} = M_{pq}^{*}$. As a ...
0
votes
0answers
113 views

How to speed up my code with constructing matrices [closed]

I have run this program for a long time to get the result for n = 2048(about 5hours) and no more result till now (can't run with n = 4096). I would know how to make it more efficient. Any help or ...
4
votes
5answers
325 views

Check whether array has only constant entries?

I have an array arr with n entries. Now I want to check whether ...
2
votes
2answers
160 views

Problem using Position applied on matrix with Infinity elements

Am I doing something wrong here? ...
4
votes
2answers
241 views

Finding the Position of the Minimum Neighbor for Each Element in a Large Matrix

I have a large matrix ($6020\times 8452$), and I want to create a new matrix where the relative position of the minimum neighbor is each element in the matrix. For example, if I had the matrix $\...
7
votes
1answer
314 views

mathematica 10 not showing numerical solution of differential equations?

I just got the new mathematica version 10 and tried to solve the following system of differential equation. $$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{...
1
vote
1answer
108 views

Option: number of digits

The command NestList[Cos, 1.5, 10] produces the list: ...
5
votes
1answer
101 views

How can I make 1+$MachineEpsilon not look like 1?

I undarstand that 1+$MachineEpsilon is actually not equal 1. However, it persists to look like it was equal ...
1
vote
3answers
259 views

Operations on transfer function model

Suppose I have a transfer function defined via TransferFunctionModel, e.g. tf == TransferFunctionModel[{{1/s}}, s]. How can I ...
7
votes
2answers
412 views

Building Butterworth Bandpass Filters

In order to bandpass filter data it is necessary to use ButterworthFilterModel, followed by ToDiscreteTimeModel and RecurrenceFilter. I have two questions: I wish to specify the order of the ...
0
votes
1answer
82 views

How make first automatic numbering cell for a style number 1 not 0?

I have a cell style "Figure" for a notebook, defined as: Cell[StyleData["Figure", StyleDefinitions -> StyleData["Text"]], MenuSortingValue->10000] In ...
2
votes
2answers
190 views

Showing steps for TrigExpand

If I enter a double equal sign and the following in Mathematica 10: == integrate 1/(1+x^4) Then wolfram alpha allows me to select a Step-by-step solution, which ...
1
vote
0answers
57 views

Complex input for Compile makes it slow

I asked a question here and then tried to use Compile for the solution to gain even more speed. Inside Compile there is a loop ...
2
votes
1answer
129 views

How get repeated elements from two lists

How to write a code that takes an certain element related to a given subset in a LIST 2, that occurs also in a LIST 1? for example, there are two lists: ...
3
votes
2answers
159 views

How to deal with the condition that a function own many options?

Assming that I have a function myFunc which has some options. ...
6
votes
1answer
381 views

VectorPlot3D - vectors starting at points

Normally the vectors in VectorPlot3D ar attached the middle. How to get them attached at the beginning (what is typical conventions in most textbooks) by use of VectorPlot3D ?
1
vote
0answers
123 views

using Mathematica library in Java

I am trying to build a Math expression calculator in Java. Is any way for using Mathematica libraries in Java program without ...
11
votes
1answer
179 views

Why is this evaluation halved when adding units?

Why does this strange behavior occur when dealing with units and quantities? ...
7
votes
2answers
232 views

Given the OneIdentity attribute why is GCD[a] evaluated to GCD[a]?

GCD has attribute OneIdentity so I expected GCD[a] being evaluated to a?
3
votes
1answer
137 views

Making table of matrix product and efficiency

I want to make a table in which each element is a matrix product: ...
14
votes
3answers
744 views

How can FactorInteger be so slow if PrimeQ is fast?

My 8th grade son had a homework problem to find a prime factor of $99!-1$. I thought to be clever/lazy and used FactorInteger[99!-1], but it takes forever. ...
3
votes
2answers
565 views

How to NOT simplify fraction

How can I prevent Mathematica from simplifying fractions? What I would like to do is run a test on a list of fractions to see how many are in their reduced form. For example, I have a list: ...
4
votes
1answer
351 views

Transform a table (list of associations) to a flat association

I would like to transform a table like ...
8
votes
3answers
237 views

Multiple bwspec for BoxWhiskerChart

If I want to make a horizontal boxplot (with outliers) for y: ...
1
vote
0answers
59 views

How to put Black as the background colour, and text as white in Mathematica? [duplicate]

My question is equal to this one,even though by different reasons. I would like to know how can I change the white background to black, and the black text to white. I'm asking again, since a year has ...
6
votes
2answers
248 views

When analytical and numerical methods do not agree - Case study with Maximum Likelihoods methods

Here is the probability distribution I am interested in: $$P(q)=C e^{4 n s q} q^{4 n \nu - 1} (1 - q)^{4 n \mu - 1}$$ , where $e$ is the constant of Euler and $C$ is constant so that the whole thing ...
-1
votes
1answer
128 views

Find $r$,in terms of variables $U$ and $V$

I want to solve this equation, for $r$: ...
-1
votes
2answers
210 views

How to compute LLL-reduce basis from lattice in Mathematica? And factor N

original article Clear. What is k? What is suitably large? I already have large numbers. I tried this WITHOUT k: ...
0
votes
1answer
137 views

Vectorize pixel SphericalPlot

I have a question about Mathematica images exporting. I have created 3d (SpericalPlot) with coloring function on it and then exported it to pdf. Is there any possibility to make more vector graphics ...
6
votes
1answer
168 views

Loading Packages with Parameters

I have some packages that uses database connections inside it, let's call it ConnPackage. The connection IP is a public package variable, and has a default value: <...
0
votes
1answer
90 views

I'm trying to iterate a function with two variables [closed]

I have a function that calculates temperature that is dependent on both temperature and time. I want to be able to iterate the function to calculate a new temperature and then use that as the next ...
12
votes
1answer
310 views

Orderless pattern matching

The MMA docs state that "In matching patterns with Orderless functions, all possible orders of arguments are tried". Why then does the following not work? ...
3
votes
2answers
324 views
2
votes
2answers
553 views

How to show surfaces as a implicit plot in 3d?

I was trying to show a feasible region with these lines: ...
6
votes
2answers
521 views

Polar Decomposition

I'm new to Mathematica 10 (half-a-month user). I'm looking for a function of polar decomposition but for now I cannot find it. Can anyone tell me about related functions. Thanks in advance.
0
votes
2answers
208 views

Decimal-to-ASCII conversion

I have to write a program that converts a number (decimal notation) to an ASCII string. For example, x = 26728 (or 0x6868) and the string is "hh". I wrote this, but it seems that it is not the ...

15 30 50 per page