2
votes
2answers
157 views

Comparing elements of the $n^{\text{th}}$ sublist in a ragged list with the $n^{\text{th}}$ member of a sequence

I have a list of lists that are not of the same length (for example, {{6}, {14}, {6, 26, 30}}), but I have to compare every element in the $n^{\text{th}}$ sublist ...
4
votes
1answer
150 views

MapThread with several cells as output

Assume I have defined the following function: FF[{x_, y_}] := {x^2 + y^3, 3.5*x*y} I would like to apply FF on a list of ...
18
votes
1answer
2k views

How to demodulate an FM signal in continuous-time?

I'm not sure if this is a math or Mathematica question, but I'm posting it here because I'm interested in possible Mathematica tools/functions to solve the problem. I'm stuck. I want to simulate ...
35
votes
3answers
3k views

Calling MATLAB from Mathematica

How can I call MATLAB functions directly from Mathematica and transfer data/variables between the two systems?
15
votes
1answer
377 views

CountryData and the areas of the world

If I add the WaterArea and the LandArea of the world, I get the same number as if I asked for the total area of the world in the first place: ...
0
votes
1answer
137 views

Slow Dynamic Button Does Not Print [duplicate]

Possible Duplicate: Why do buttons with ChoiceDialog freeze the front end? Why is SystemDialogInput failing to return a save file path? Evaluation inside Button stops after some seconds I ...
8
votes
1answer
758 views

Improving the source-code indentation in Wolfram Workbench

One thing that I like about the more recent versions of the Mathematica front-end is that I think it does a good job indenting code. The language's functional nature, in my experience, leads to a lot ...
14
votes
2answers
1k views

Obtaining joint distributions and conditional distributions using Mathematica

I have two multivariate Gaussian distributions $p(x)$ and $p(z)$ with mean vectors $m_x$ and $m_z$, and covariance matrices $\Sigma_x$ and $\Sigma_z$. my model is a simple linear model $x = W z+n$ ...
19
votes
8answers
623 views

Applying And to lists of Booleans

I'd like to take {True,True,False} and {True,False,False} and apply And to get ...
3
votes
4answers
168 views

Pack Solve results into a vector

I am currently using a really easy function to get the eigenvectors of a corresponding eigenspace: ...
1
vote
1answer
106 views

How can I manipulate with elements inside sublists if sublists of different lenght?

I have some kind of output like this: {{1, 5}, {1, 13}, {1, 5, 25}}. I would like to be able to enter in each sublist and make sums of every two elements in sublists, for example my desired output ...
3
votes
2answers
97 views

How to uncompress only the compressed elements in a matrix

I have data in a rectangular structure – something like matrix={{a,b,c},{d,e,f},{g,h,i}}. The problem is that some of the columns consist of uncompressed data and ...
5
votes
6answers
324 views

Creating sums of elements from a list

I have a list $(d_1, d_2, .. d_k)$ and I want to create all sums that I get for adding only two elements for my list $(d_1+d_2, d_1+d_3,...d_{k-1}+d_k)$. The ...
2
votes
4answers
2k views

How to export data from For loop in text file?

I'm new in Mathematica and I am trying to write numbers from 1 to 10 in txt file. But "Null" is everything that is written in my file. The code is: ...
9
votes
2answers
121 views

How to force native styling of controls?

While preparing a dynamic module, I discovered a weird behaviour of Mathematica's controls when you rotate them: ...
2
votes
1answer
193 views

How do you define an affine transformation that is translated by itself?

This one should be simple, but I can't figure it out. I would like to define a transformation (function) such that $r$ maps to $m.r + r$ The help file on AffineTransformation says that ...
10
votes
4answers
802 views

Plotting a complex valued function over a circular region

I would like to apply some complex valued function to some region in the plane, say, a circle of radius $R$ centred at $k$. How can I do this?
8
votes
3answers
376 views

Where in the documentation can I find a list of function argument types?

Recently, I learned that it is possible to assign "types" to function arguments in the definition of a function. Suppose I have a function stringFun that does some ...
13
votes
7answers
375 views

Get the first element after the first sequence of length N of consecutively increasing values

I'm looking for an efficient way of extracting the first element after the first sequence of N consecutive elements in which the values are increasing. If these are the data of a toy example: ...
5
votes
2answers
361 views

How To Span Table Headings?

What I am doing wrong? I would like to get a header to the table and based on your code I tried this: ...
7
votes
1answer
616 views

How to map rotate, pan, zoom to manipulate controls

I am wondering if there is a way to restrict the motion of the rotate mouse cursor in when moving around a 3d plot. For example, I want the y direction of the cursor to correspond to pulling the z ...
13
votes
1answer
255 views

Problems with images caused by which stylesheet is used

Update This looks now like it was a bug in Mathematica version 8, because everything works as expected - at least for this minimal example - in version 9. (As an aside, I couldn't seem to find ...
8
votes
1answer
346 views

How do you insert more columns into Table cells?

How do you insert more columns into Table cells as shown below? To get to this table, go to File -> New -> Styled Notebook -> Textbook -> New -> Scroll down to the Table Cells.
4
votes
1answer
129 views

Tweaking Prime[n] to return 1 when n==0

I manually evaluate this cell to set Prime[0] Unprotect[Prime] Prime[0] = 1 Protect[Prime] I manually evaluate this cell to reset Prime[0] ...
7
votes
7answers
451 views

How to pick an element of a row corresponding to the minimum in a particular column?

How can I find what value in column 1 of my list corresponds to the minimum value in column 2?
5
votes
3answers
339 views

ComplexInfinity/Indeterminate error when evaluating derivative

Motivation: I want to find the coefficients for the polynomial that is obtained when one adds together the first $n$ natural numbers to the power of $a$; that is, when you consider $1^{a} + 2^{a} + ...
3
votes
3answers
538 views

Converting a string containing whitespace-delimited numbers to a list of numbers

Suppose I have a string str that contains only whitespace-delimited real numbers: ...
3
votes
1answer
384 views

Handing a list of constraint expressions to a C++ function with MathLink

I need to solve an optimization problem, which is defined in a Mathematica notebook. Using Mathematica's FindMinimum is not an option, because it is too slow. So, ...
14
votes
2answers
306 views

How to make use of NumericQ[x] = True (and use it safely)?

Basic Issue: I'm trying to understand the proper use of NumericQ's "magical" capabilities. Please consider the examples below. Actual question and some links are ...
11
votes
1answer
511 views

Formatting and printing lists with Mathematica scripts

I'm just starting out with Mathematica and I'm using MathematicaScript rather than the GUI. However, I'm having trouble formatting a list when printing it. Suppose ...
5
votes
3answers
292 views

How to force Dt[ ] to recognize dependencies

I want to differentiate a function f[] for which I don't have a specific expression. f[] depends on ...
3
votes
1answer
285 views

Increasing the tickrate of an ErrorListLogPlot

I'm new to Mathematica and am trying to do an ErrorListLogPlot using the "ErrorBarLogPlots" package (from the Wolfram Library) for a graphical evaluation. ...
8
votes
3answers
604 views

Variable variable names

I have two variables, $ u \in \{0,40\}$ and $\gamma \in \{0,1\}$. I take $10$ values of $u$ and $5$ values of $\gamma$ and using their combinations as a pair of input parameters, I perform some ...
9
votes
2answers
278 views

Manipulating OptionsPatterns[]

How do you combine OptionsPatterns? For example, I would like to have a function that can take both options that I specify, and options for all graphs: ...
3
votes
1answer
173 views

Efficiently keeping elements in a list (an input list) that exist in another list (a keep list)

I have some code that generates lists of integers (one such list is called, for example, inputList). I also have a "master list" of integers that should be kept, ...
7
votes
1answer
269 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 ...
12
votes
3answers
2k views

How to use FindFit to fit an implicit function?

Now I am trying to fit some data with a implicit model function. Firstly, I tried a toy example. Toy example with input and output ...
19
votes
3answers
379 views

Nested definition: How can I define a function with a passed-in expression?

Here's a simplified version of what I'm trying to do: ...
13
votes
1answer
400 views

What strategies can I use to evaluate a limit when Limit[] returns unevaluated

I'm trying to find the following limit using Mathematica: $$\lim_{N\to\infty}\sum_{k=1}^N\left(\frac{k-1}{N}\right)^N$$ The problem is taken from here and is known to converge to ...
11
votes
3answers
1k views

Correcting a correlation matrix to be positive semidefinite

Does Mathematica have a way to "fix" a correlation matrix that is not positive semi-definite? I looked through the documentation and search the internet but could not find anything.
23
votes
6answers
2k views

Convert an expression to a Function

I need a function which can take an expression and return a pure function based on the symbols in the expression. The symbols might have values so must be protected from evaluation. It is probably ...
6
votes
1answer
593 views

How to turn a random graph into a matrix

I have constructed a random graph with Mathematica using the RandomGraph command. Now I would like to convert this graph to a matrix, but I don't know how. The ...
7
votes
2answers
264 views

How to Rasterize in “Printout” style

I am trying to ascertain how large a justified text block will be when printed by rasterizing it in the "Printout" style environment. However, ...
1
vote
1answer
173 views

How can I make CDF which uses user defined function

I have a user defined function which is called many times in the code. I want to ask that when I am deploying the code toCDF, I need to define that user defined ...
4
votes
3answers
378 views

Table in a Legend

Calculated data: ...
3
votes
2answers
580 views

How to avoid this kind of numerical error caused by extreme parameters when using NDSolve?

Here I use a one-dimensional heat conduction equation as the example. I found that when the thermal diffusion coefficient is small enough, Mathematica will give a result against the second law of ...
8
votes
2answers
391 views

Series expansion with irrational power

I need the series expansion of a fairly nasty function and its derivative: ...
7
votes
1answer
1k views

Probability and distribution from actual data

Let's say I have some data from a real world system: ...
13
votes
1answer
915 views

How to find out available fonts from within Mathematica?

How to find out available fonts on the system from within Mathematica? When I do Style["foobar", FontFamily -> "Foobar"] how do I know which font the ...
0
votes
1answer
927 views

How to add a grid on Plot, ListLinePlot and ListPlot? [duplicate]

Possible Duplicate: How to insert guide-lines in graphics without specifying range? When we're using ArrayPlot, it's possible to draw a grid by doing: ...

15 30 50 per page