# All Questions

80 views

Why does ...
528 views

### Optimization of a portfolio of stocks

I would like to use Mathematica to perform an optimization of a portfolio composed by 10 stocks. I did the first part to compute yields and expected yields, but I don't know how to finish the ...
178 views

### Gamma Incomplete Function representation in Mathematica and Matlab

I am confused about Gamma Incomplete function calculation in Mathematica and MatLab: For example, in Mathematica: Gamma[5,3] = 19.56 But in MatLab: ...
118 views

### Mathematica output in ASCII or larger text size for the output?

I am trying to read the output of this code that has crosses, circles and spaces. For some reason, the output is in very-very small alphabets so I would like to get it in ASCII and/or in larger ...
1k views

### Determine the 2D-Fourier transform of an Image

I am new to Mathematica and using Version 8.0. I want to calculate the 2D-Fourier Transform of a digital image and see its Magnitude and Phase Spectrum, and reconstruct it.
85 views

### Simplify looks ugly [closed]

I use Simplify mostly to make expressions look neat. However, Mathematica often does not produce expression in, what I consider, the optimal way. Look at this: ...
137 views

### Symbolic derivatives are being calculated numerically

Just found the following while debugging a problem. Mathematica is calculating the derivative of IntegerPart[x] in some odd way: ...
213 views

### Upon PDF export, edgeless rectangles do not tile perfectly, and corners may be cut. Is this a bug?

Exporting the following as a PDF file Graphics[{ {Red, Rectangle[{0, 0}, {1, 1}]}, {Green, Rectangle[{1, 0}, {2, 1}]} }] does not produce perfectly tiled ...
304 views

### Why does LogLinearPlot sample its argument outside the specified domain?

I experience a weird bug in the function LogLinearPlot. If the input is an interpolation function, such as the one created like this, ...
722 views

### Converting a large floating-point number to a single-line string

When I feed a large (or small) enough floating-point number to ToString, it produces a two-line string, with the first line containing only the exponent of 10: ...
121 views

### Possible to draw an Item in a Grid with only 3 sides of a Frame?

I'm trying to draw a Grid of characters where some of the characters have Frame lines on 3 sides. For example: ...
337 views

### Equivalent Nested Loop Structure

Consider the following examples: ...
739 views

### Evaluation of a triple sum does not finish in reasonable time

I'm trying to compute the following triple sum, but no result is produced within a reasonable amount of time. What to do? ...
169 views

### How to get an adaptive frame which fits auto-wrapped text? [duplicate]

When using the built-in Debugger, the breakpoints and the current step will be framed looks like this: My favorite part is, those frames are adaptive to the text when window width changing makes it ...
276 views

### Using uniform coloring in MatrixPlot

I have a rectangular matrix, which is m-by-10. Each element is either 0 or 1. I would like 0 to correspond to white elements, and 1 to red elements. This works ...
2k views

### How do I draw a DensityPlot in polar coordinates?

I am trying to plot $J_m(\chi_{mn} r) \cos(m\phi),$ where $J_m(\chi_{mn}) =0,$ as a DensityPlot in polar coordinates (solution to 2D wave equation in polar ...
259 views

### Arguments to If[] are not evaluated

I got bitten by the following: f[x_] := 3*x; g[x_] := If[Log[f[x]] < 0, f[x], 0]; g[x] Out[11]= If[Log[3 x] < 0, f[x], 0] where I thought the call to ...
233 views

### Effects of single-point and multi-point calls of Point on plot range

Several Graphics primitives are listable. For instance, Point accepts lists of coordinates so that multiple calls to Point are ...
310 views

133 views

### Compile not correctly initializing a variable defined inside Module

In the following example, inside the minimumX's Module, x is initialized to 1, but the ...
207 views

### Why is ReplaceAll behaving like this?

I'm learning to use the ReplaceAll function and I found the behavior of which is quite confusing. For Sqrt[f[x, y]] /. f[___] -> u Mathematica returns ...
576 views

### Functional programming and Do loops

I'm writing a Monte Carlo simulation. I'm using a Do loop to create the different simulations, iterating over different ...
267 views

### Defining Tags in Reap

I am trying to use Sow/Reap to replace Append in my code. The problem is that I need to ...
770 views

### BarChart frame labels

This barchart was tricky to style, and I had to resort to the legacy BarCharts`package. Any ideas how to omit the labels from the bottom edge? Ideally I'd also like ...
212 views

### What default theoretical distribution does Mathematica use in PearsonChiSquareTest?

I used Mathematica's function PearsonChiSquareTest to test whether the data were drawn from a normal distribution. As in the reference, I expected Mathematica to compare the result to a normal ...
230 views

### Fill out blanks with a upcoming number in a list?

I have a bunch of arrays looking like this: {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ...
926 views

### InterpolationOrder for ContourPlot

How do I acheive something like InterpolationOrder in ListContourPlot for ContourPlot? My ...
1k views

### How to sum up subelements of a list of unknown length

I'm simply looking for the {}+{} function for sublist elements of a list: (Parallel sums of elements) ...