All Questions

Filter by
Sorted by
Tagged with
5 votes
1 answer
622 views

Use Pattern with Vectors in Assumptions

I had a problem using Pattern with Vectors in Assumptions. Here's how I use ...
9527's user avatar
  • 529
1 vote
1 answer
409 views

function returning 0

Why is my function returning 0? ...
dustin's user avatar
  • 249
8 votes
2 answers
1k views

Adjusting Density Plot Color Function for Diffraction Simulation

I'm trying to simulate Fraunhofer diffraction by a single slit using DensityPlot I run the code: ...
John Smith's user avatar
16 votes
1 answer
1k views

Ellipse counting from image

I have hundreds of images similar to this image: I'm looking to count the number of ellipses as well as their major and minor diameters. The ellipses are touching, hence, ...
Andrew Stewart's user avatar
0 votes
1 answer
2k views

Ellipsoid in spherical cordinates

I am trying to plot in spherical coordinates the ellipsoid defined as $$(x/3a)^2+(y/2a)^2+(z/4c)^2=1$$ This is my code: ...
soboma's user avatar
  • 1
3 votes
0 answers
411 views

Exported PDF figure looks different in Apple's Preview than in Adobe PDF Reader

I'm trying to export figures into pdf, and the results looks good in Preview, but very bad in Adobe pdf reader. I'm using Mathematica version 8 on Mac 10.8.5. The Preview version is 6.0.1 (765.6) and ...
xslittlegrass's user avatar
1 vote
1 answer
115 views

Issues with creating functions [duplicate]

Sometimes when I try to create a function inside a function, Mathematica gives me a hard time. I usually just have to play around with the syntax until it gets something it "likes" but I really have ...
Steven Sagona's user avatar
20 votes
9 answers
4k views

Position of the first nonzero number

I want to know is there any one line code to find position of first nonzero number without calculating position of all non zero numbers. For example, ...
Vajira's user avatar
  • 601
12 votes
4 answers
1k views

How to replace every possible $A+B$ and $AB$ in expansion of $(A+B)^{10}-A^{10}-B^{10}$ with $x$ and $y$, respectively?

I would like to replace every possible $A+B$ and $AB$ in expansion of $(A+B)^{10}-A^{10}-B^{10}$ with $x$ and $y$, respectively. How to do it with the simplest code in Mathematica? For example, \...
kiss my armpit's user avatar
1 vote
1 answer
2k views

Solve a total derivative - independent vs. dependent variables

I am trying to force mathematica to solve a generally defined function for d lp: In a reduced version, w depends on l2, ...
Andreas's user avatar
  • 103
0 votes
1 answer
103 views

Manipulate that remembers its own input code and can show it by request

This question is a further question to my previous one. The solution for that question works well as long as the original input Manipulate code is still provided in ...
saturasl's user avatar
  • 1,429
12 votes
7 answers
8k views

Filling a curve to a vertical axis

I am preparing a figure for an article, and I would like very much to be able to fill a curve, but not under it, but to the vertical axis, i.e. to the left. Due to the meaning of the data I present, I ...
Dr_Zaszuś's user avatar
3 votes
2 answers
469 views

Make fraction with selection in denominator

Using ctrl/ you can make a fraction. If you have selected something it will appear in the numerator. Does there exist a shortcut to make the selected text appear in the denominator instead? If not, ...
Tyilo's user avatar
  • 1,545
19 votes
9 answers
2k views

Finding the best way to visualize rather complicated data

I have the following data ...
Vaggelis_Z's user avatar
  • 8,760
0 votes
1 answer
181 views

How to make an index optional?

Can I define a relation between variables, such that the expression will also be evaluated (then assuming all indices are equal) when no index is given? $$ x_i + y_j = \delta_{ij} \stackrel{...
ahambi's user avatar
  • 101
1 vote
2 answers
1k views

Row-Reduced-Echelon-Form with Equation Parameters for Consistent Systems

I often do row-reduced-echelon-form (RREF) calculations that involve parameters using the RowReduce command. Most times, I want to know which parameters make the system consistent. For example: <...
Amzoti's user avatar
  • 1,075
4 votes
2 answers
1k views

Find the value of parameter so that the equation has one solution

Let $(E_l) : x^4-4x^3+x^2(5-l^2)+4 x l^2-4l^2 = 0$ be an equation with $l$ as a parameter and $x$ as an unknown and $S_l$ the set containing all the real solutions of $(E_l)$. Then there is a unique ...
Cydonia7's user avatar
  • 2,529
4 votes
1 answer
121 views

Evaluate open cell segments in a notebook

The Evaluate > EvaluateNotebook evaluates the whole notebook. Is it possible to somehow evaluate ONLY the open sections of a notebook?
my account_ram's user avatar
2 votes
2 answers
2k views

Coloring vertices using GraphPlot

I have the following problem: I used GraphPlot to plot my adjacency matrix. I divided my nodes in three groups: ...
Friedrich Nietzsche's user avatar
5 votes
1 answer
485 views

Is it possible to interact with an external program's command-line interface?

I am performing a calculation in Mathematica which relies on calls to an external program that acts as a black box for calculating a function $f$, and I would like to know if it is possible for ...
Emilio Pisanty's user avatar
2 votes
4 answers
3k views

find the number of integral solutions a+b+c+d+e+f = 18 [duplicate]

Find the number of integral solutions of a + b + c + d + e + f = 18 where a, b, c, d, e, f are elements of the range ...
anu's user avatar
  • 21
2 votes
1 answer
451 views

How I can make a menu with different graphs with modifiable parameters?

I want a user friendly window in which to have a menu where you can choose the chart you want to display, in which you can move parameters in order to note the width or height of the chart, but I try ...
Starlight's user avatar
5 votes
1 answer
217 views

how to load everything when opening a saved notebook

generally, when I carry over work in a notebook from the previous day, I have to physically start from the top and re-evaluate every statement before I can begin from where i left off. Is there any ...
Sid's user avatar
  • 121
0 votes
1 answer
283 views

Workaround for automatic replacement of "\r" to "\n"

When I run the following code in an empty notebook SetOptions[EvaluationNotebook[], testOption -> "\n\r"] and then open the notebook in Notepad, I find $...
Hector's user avatar
  • 6,438
4 votes
3 answers
592 views

Improve the performance of solutions to Project Euler (#14)

Problem I have following code, when n<=10^5 it's not slow, but n>2*10^5 it's became very slow. I think maybe some temp value greater than 2^31-1, so make compile invalid. Could you give any idea ...
expression's user avatar
  • 5,642
6 votes
2 answers
629 views

ParallelMap and Sow/Reap - not behaving as expected? [duplicate]

Is ParallelMap and Parallelize@Map expected to work with Sow and Reap construct. This is a rather brief toy code to find all Primes just to force the use of Sow/Reap inside Map ...
my account_ram's user avatar
5 votes
1 answer
382 views

PearsonChiSquareTest: set degrees of freedom

How to set degrees of freedom for PearsonChiSquareTest? I have this: ...
Medvedev's user avatar
  • 153
5 votes
1 answer
288 views

Drawing a quadrangular surface

Is there a way to draw a quadrangular surface in Mathematica so that it shows the bilinear term (not two triangles)? The quadrangular polygon is given by the expression $$\phi = \sum_i^4 N_i U_i$$ ...
Alejandro Marcos Aragon's user avatar
6 votes
1 answer
1k views

How to define a button inside Manipulate that tells Mathematica to re-evaluate the whole Manipulate code?

I have written a Manipulate code carrying out some very complicated tasks. There is no problem for the first run, but if I click the reset button to reset all ...
saturasl's user avatar
  • 1,429
6 votes
2 answers
2k views

Merging Vertices of a Graph and adding up the edges weights

I have a Weighted Graph of g which looks like this. ...
Alex's user avatar
  • 1,235
4 votes
4 answers
235 views

How to get a list of pairs into the form $(x,y)$?

I want to put the solutions of the equation $y = (x + 3)/(x - 3)$, where $x$, $y$ are integers, into the form $(x,y)$. For example, $(2, -5)$ instead of $\{2,-5\}$. When I evaluated ...
minthao_2011's user avatar
  • 4,503
0 votes
2 answers
900 views

Plotting problem

I was wondering why I keep receiving the error message "Derivative should be a triple of numbers, or scaled form" from the following code ...
Jeff's user avatar
  • 1
4 votes
2 answers
195 views

How to optimize computing a product?

Problem description Write a function to caculate the formula My solutions Solution 1: ...
xyz's user avatar
  • 625
4 votes
0 answers
117 views

Can I define a "postfix map" operator with comparable precedence behavior to // [duplicate]

I am trying to define a "postfix map" operator (denoted $OP$ for now) that behaves thus: ...
mfvonh's user avatar
  • 8,460
3 votes
4 answers
124 views

Check whether a function of two variables is a probabilty distribution function

I have a function like this $f(x,y)=c\,y\,(y-x),\ \text{for}\ 0<x<2,\;-x<y<x$ and I need to find the value of $c$ such that $f(x,y)$ is a PDF. How can I do that? I know that the ...
xmpirate's user avatar
  • 133
0 votes
1 answer
311 views

Testing Equality Expression?

Even if in Graph[{1 -> 2}] == Graph[{1 \[DirectedEdge] 2}] the answer is True ; but why MMA doesn't show the result of the ...
Alex's user avatar
  • 1,235
1 vote
2 answers
205 views

Expression giving multiple plots of a function, where each plot varies according to the value for a certain parameter

How can I plot multiple plots for M = 10, 20, 50? ...
dustin's user avatar
  • 249
5 votes
1 answer
237 views

Looking to create a lesson on sensory perception of sound

I'm looking to show students a lesson on sensory perception, more specifically on masking. I know a little Mathematica but sound processing has evaded me. I would like to create a white noise and ...
Levi's user avatar
  • 425
4 votes
4 answers
706 views

How can I make controls have Button-like behaviour?

The Button control is very easy to understand Button["Press Me", Print["Pressed"]] I press the button, I execute the function....
WalkingRandomly's user avatar
5 votes
3 answers
628 views

Vertex Multi-labeling on a Graph Network

We can have this Graph: ...
Alex's user avatar
  • 1,235
2 votes
1 answer
244 views

Input[] inside DynamicModule causing a kernel crash [duplicate]

I have those few lines of code causing a crash and I can't figure out why: ...
Öskå's user avatar
  • 8,587
8 votes
5 answers
196 views

Expanding lists with split strings

I've got data of the type: list = {"Class","MW","10 - 11"} which I would like to split into a number of lists based on the number of characters in the second ...
bobthechemist's user avatar
0 votes
1 answer
143 views

Evaluate outer function first

I'm new in Mathematica so this is maybe super easy to do, but I can't figure out how. I've got a function plus[a,b] that sums two numbers and I need to implement a ...
Micer's user avatar
  • 111
7 votes
1 answer
376 views

RandomVariate does not fill range of PDF of distribution

I've declared my own probability distribution as follows dist[a_, b_] := ProbabilityDistribution[Cos[(b x)/2]^2 Sinc[a x]^2, {x, -400, 400}]; When I try to ...
mrkprc1's user avatar
  • 73
2 votes
0 answers
201 views

Equation Solving: Solution in terms of predefined functions

Is there a way that I can have Mathematica give me the solution of a problem it has solved in terms of functions that I have predefined? The specific problem I'm trying to solve is: ...
Dave S's user avatar
  • 121
13 votes
4 answers
734 views

How do you get a list of filenames from a URL?

How would I get a list of filenames available at a URL? For example, list the files at: http://www1.ncdc.noaa.gov/pub/data/cmb/drought/weekly-palmers/2005/
WalkingRandomly's user avatar
8 votes
1 answer
243 views

FindSelectedFunction for packages - how to make it work?

Fixed in 10.0. Works correctly since Mathematica 10.0. The Mathematica help menu contains an entry Find Selected Function (Cmd+Shift+F on OSX). If you are working with say ...
wolfies's user avatar
  • 8,722
0 votes
0 answers
37 views

Solving an algebraic equation with one or more constraints? [duplicate]

Just as a simple example, say I wanted to solve Sin[x] == a for x with the constraints -1<=a<=1 and 0 < x < Pi. Is there any way to do this?
Izzhov's user avatar
  • 101
0 votes
0 answers
220 views

How to improve the quality of 3D rendering? [duplicate]

I am trying to combine various 3D objects for a composite image. But some of the objects just don't look very good. In the end, I want to have a publication-quality image. For example, here I ...
Jason B.'s user avatar
  • 68.4k
4 votes
0 answers
197 views

MathKernel with `-noprompt` hangs indefinitely when converting simple TeX expression

If I enter MathKernel -noprompt -run 'ToExpression["1", TeXForm]; Exit[]' the kernel hangs, apparently while running TeX.exe ...
Mike's user avatar
  • 250

15 30 50 per page