All Questions

217 views

Plotting recursive from a for loop

our assignment is that we have make a plot for the possition of 1's From the recursive function if a[n-1] is even then ...
294 views

Compile nested Sums

I want to compile an expressions that contains nested Sum-expressions. A simple example that gives me problems is: ...
65 views

Show actual Interpolation function [duplicate]

Is there a command to show the actual function when using the Interpolation command? For example, f = Interpolation[{1, 2, 3, 5, 8, 5}] returns ...
128 views

How to plot a 2-D function of points which is a function of points from the Unit Circle

Consider the set of points $(x,y)$ such that $x^2+y^2=1$. Consider the functions $f(x,y)$ and $g(x,y)$ and I want to plot the set of 2-D points whose co-ordinates are $\left(f(x,y),g(x,y)\right)$. An ...
436 views

A documented syntax of FileNames doesn't work?

Documentation discrepancy present through 10.3 According to the documentation for FileNames under Details: However when I attempt to use this syntax I get an ...
42 views

Numerical Error with Matrix operations [duplicate]

A is a 3x3 matrix, b is a 3x1 vector. I try to convert [A|b], a 3x4 matrix, to [I|0]. So the formula is right multiple ...
460 views

How can I read compressed .Z file automatically by Mathematica?

When I read .Z file by something like jpldatstring = Import["ftp://cddis.gsfc.nasa.gov/products/jpl/2003/jplg0040.04i.Z"] Unfortunately, it turned out that "...
132 views

Rename a list of files [duplicate]

I need to rename a list of files .bmp having name like 1.bmp, 2.bmp,...,155.bmp. I want to get a list of files having the same number of digits in name like 001.bmp,002.bmp....,155.bmp. I am trying ...
64 views

How to update Plot and some output inside NDSolve callback (StepMonitor)

I have the following problem. I am calling NDSolve to solve a system of first order differential equations (nothing fancy), except that the number of equations measures in thousands and the number ...
93 views

Error using Nsolve with system of two equations: “Use Reduce”

Having some odd behavior with some mathematica code I am running. I am solving a simple system of two equations but mathematica gives an error and asks to use Reduce? I looked up in the manual but ...
127 views

Manipulating parameters in a complex algorithm

I have a complex algorithm that depends on: A wavelet basis A number of sampling points out of a distribution A thresholding value I want to be able to play with different scenarios using ...
147 views

Calculate the relationship between the duration of two oscillating functions

I am trying to quantitatively determine the relationship between the length of two oscillating functions. Meaning, what is the duration of the green spike in relation to the blue square? Does anyone ...
78 views

How to select default graphics device for charting?

Is there a way to tell Mathematica to use a specific graphics device for charting? My laptop has two graphics devices; an on-board Intel chip and a Nvidia graphics card. I noticed in Mathematica's ...
355 views

J/Link doesn't work with Java 8?

I have some code that successfully uses J/Link (well... until today when something I was doing something with it that crashed the JVM, so), and I recently tried running it under Java 8. I then get a ...
76 views

How to Overwrite the DisplayFunction?

How to overwrite the display function of TemplateBox? For example, if I have: ...
120 views

Casting Dataset internal type from Assoc to Struct

Using: planets = ExampleData[{"Dataset", "Planets"}]; The full form of this projection displays the internal type def: ...
438 views

How to replace the first occurance in an expression instead of replacing all?

Is there a function that replaces the first occurance of the expression instead of replacing all? For example, if I have HoldForm[x + 2 + 4 + x] /. x -> 4, is ...
960 views

How do I store values in a for loop into an array and then plot that array? [duplicate]

What my title said and I want to plot the values of the array. still new to mathematica and programming so its hard to formulate my question just right
1k views

How to assign a list of numbers into letter grades

Here is my list: ...
64 views

solving nonlinear equation [duplicate]

I typed this below code in mathematica 9.0 but wasn't solved: ...
920 views

Finding the surface area of a 3D convex hull

I have noted several instances here and here where ConvexHullMesh, introduced in v10 has been used to greatly simplify some geometry problems. Determining the ...
27 views

Coloring problem in plot3D with transparent texture [duplicate]

I need to plot multiple surfaces with textures. Each texture is a matrix plot with transparent background. In this way, we can see the multiple surfaces from the top. ...
248 views

Another weird plotting result

I asked a question this morning here, which has been resolved. However, I got another problem. I want to add some lines to the graph, which turns out glitched. The code is as follows, ...
321 views

Random Integer Sequences

I want to construct a random square matrix in the following manner: a) Three states [0 | 1 | 2] are repeated ...
109 views

JordanDecomposition in Mathematica

I'm trying to find the Jordan Decomposition in Mathematica for  A=\left( \begin{matrix} 2& -5& 8&-12\\ 1& -2& 4&-8\\ 0&0&2&-5\\ 0&0&1&-2 \end{matrix} ...
164 views

Unable to compile to C

I used to be able to compile to C without problems, but from one day to the next, when I try to compile something, e.g. ...
70 views

parsing a list or vector

I have a table of elements that generate a list q[i_]=i; B=Table[q[i],{i,1,50}] I would like to parse the list meaning, take the first 10 elements, then take ...
113 views

Make a partition with a rule [duplicate]

I wrote this line of code : {{1, 1, 1}, {1, 1}} /. ((x___ /; Length[x] > 2) -> Partition[x, 2, 1]) generates this error : Partition::pdep: Depth 1 ...
287 views

Import displays DICOM images as black rectangles (Mma v. 10)

My problem concerns Mathematica version 10.0.1.0 with OS X 10.9.4, OS X 10.9.5 and it does not occur in Mathematica version 9.0.1.0 (on the same computer and OS). About 90% of my DICOM images are ...
475 views

Combining many plots with Show produces wrong x-axis position and wrong filling

The code is as follows, ...
937 views

Drawing an arrow or a solid dot on a curve?

I want to draw arrows and the solid dot like in this picture on a curve.
171 views

Question about using NDSolve with a matrix equation

I tried to use NDSolve to study a matrix-valued differential backward equation. The following program seems to work: ...
534 views

WSTP broken by upgrade to 10.0.1?

Bug introduced v10.0.1 and fixed in 10.0.2 Everything was working fine with WSTP (the successor to MathLink) in 10.0.0. But I upgraded to 10.0.1 today and now I can't compile either my programs (I'...
349 views

NDSolve giving the wrong solution?

I'm considering the non-linear second order ODE DE $=0$, with DE given by ...
2k views

How to generate a cartoon of a face

I want to use Mathematica to generate a cartoon of a face. For example, some thing like this: I think it can be done using Mathematica, but I really don't know how to do it. How can it be done, and ...
1k views

How to make a 3D topographic globe?

I've made some attempt with this dataset of elevation. But I have some trouble with ListSurfacePlot3D, which can not show the globe correctly: And I've checked that the data is out of problem, ...
727 views

How to use SparseArray in CUDA?

Sparse arrays are widely used in many scientific applications where memory and time are strictly limited. For a considerable speedup one can use CUDA. Since Mathematica 8 we can conveniently use CUDA ...
97 views

Verify positive definiteness using random numbers

I wish to verify whether T'T - IdentityMatrix[2] is always positive definite for a certain choice of elements of T'T. ...
108 views

how to depict a network with a legend

Because my network nodes have real world names more than a few characters long, I'd like to label them with a shortcut, e.g., n1, n2, n3, ..., and put a legend on the side something like this: n1 - ...
2k views

Mathematica's equivalent to the Python's Zip command in List-comprehension? [closed]

What is Mathematica's equivalent to Python's ZIP command? Is this called nesting? It means iterating over sub-sets of values like the below example. How can I do it in Mathematica? Example in Python ...
186 views

getting vertices in order from spanning tree

I've got spanning tree for some weighted graph (edges labeled 1-6) - for example: ...
117 views

Right data format when EmpiricalDistribution expects “Rectangular Array”

I have the following code to generate random data (these are the eigenvalues of a non-central Wishart matrix, and I am interested in their distribution). ...
367 views

Finding Hamiltonian path in Graph

I have weighted, undirected full graph (generated from points in R^2), where weight between every two vertices are euclidean distance between corresponding pair of points. What I'm trying to do is ...
127 views

The “Save” under “File” and “Undo” under “Edit” do not work in Mathematica 10.0 [duplicate]

Bug introduced in 10.0 and fixed in 10.0.2 Each time I click "Save" or "Undo" button from the notebook menu, some new notebook window similar to this pops up: And the file is not actually saved ...
1k views

Creating a foggy image

I want to create foggy images like this one (produced with Adobe Photoshop): Not at least familiar with Mathematica's Image processing capabilities, the only ...
121 views

Save value computed in the loop and delete it

I am using For loop to calculate a value $z$ in every cycle. I would like to create a text file, save the current value $z$ in this file and afterwards delete the value from Mathematica's memory. I ...
273 views

FindMinimum and NMinimize to solve equations

I know that I'm not a Jedi in solving Equations and minimizing functions; but now I've this problem, and the solution is far to me. I want to solve this equation: ...
170 views

How smart is Solve? Figuring out what tricks I should try

I'm trying to solve a large system (~10000) of linear equations using Solve, but the process keeps failing. As-is, I don't know whether it's failing because it's using too much memory or too much time ...
Given an $m\times n$ matrix $A$ and a $m\times 1$ vector $b$, what is the most "intuitive" way of forming the augmented matrix $[ A\ b]$? The most concise way that I know of is ...