All Questions

553 views

Why is there a huge performance gap using Map with more than 100 List entries

im using Map on a List like this: cube= {{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, ... , {5, 5, 4}, {5, 5, 5}} Mapping the whole List with 125 entries takes ...
114 views

Is it possible to Print into a collapsable CellGroup?

During rather long computation I have intermediate steps Printed with useful information which should be collected for possible use in future inside of the ...
177 views

Capturing an F1

I teach an Intro to Mathematica course, and one of the things I try to reinforce early on is just how helpful Mathematica's help is. In the very first lab for the course, I even give the students a ...
697 views

Labelling objects in a picture with numbers

I need help processing a biology bacteria picture. I just started learning Mathematica and I hope you guys can use a simple method to help me solve the problem, please do not use super complicated ...
3k views

Make a differentiable smooth sawtooth waveform

So, I am trying to understand the effect of sawtooth waveform on a mechanical system model. For example, a system of a plate and a box on it. And then we try to oscillate the plate. In order to do ...
448 views

ListPlot3D of a set of points in a non-convex region

I would like to plot a set of points in the same style as ListPlot3D does, but only in a non-convex region that I can specify (e.g. using a ...
772 views

Is there anything like a C pointer (or returning a reference) in $Mathematica$?

I want to do in Mathematica what the following does in C. ...
96 views

I am using Mathematica 9 on Windows 8, and I regularly want to use cell styles such as Section, SubSection and so on. If I click the + button before creating a new ...
318 views

Embedding StreamPlot in Graphics3D

I am trying to visualise the action of the infinitesimal generator of a Lie group on the solution of a 2-ODE system drawn in the 3D space (t,y1,y2): t is time and y1,y2 are the two dependent ...
335 views

How to fold output cells by default?

In Mathematica the default behavior of output cells is to pop up after the kernel has processed the input cells and got a result. I know I could add ; in the end of ...
1k views

How do you export the result of a RevolutionPlot3D to STL for printing?

How do you export the result of a RevolutionPlot3D to STL (STereoLithography) file format for printing? I am a tyro when it comes to 3D rendering and printing.
1k views

What is the default ColorFunction for 3D plots?

This should be a really simple question, but it isn't in the documentation for some perverse reason. I like the default ColorFunction that Mathematica uses for ...
658 views

Is Table the only functional way to construct nested loops in Mathematica?

Suppose you have a cubic box containing identical particles and you want to compute the distances between each particle and every other particle in the box without double-counting (i.e., if you've ...
187 views

Performance: Collapsing repeated contiguous rows & cols from a matrix

In this answer I needed to remove contiguous zero-valued cols and rows from a matrix, leaving only two of them in place, no matter what the original number was. I made up this code: ...
525 views

How do I find the amount of free space on disk?

I know a workaround, where one calculates sizes of all files and then you subtract this from your default space, but is there any direct way to do it? Simplicity and speed are important. There's the ...
359 views

Getting all physical units with prefixes

How we can get the list with all physical units and prefixes from WolframAlpha and make symbols from the result to be equal their corresponding quantities like described in this post?
850 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: ...
405 views

Exporting a rasterized Row of Graphics

I'm running some code based on @R.M.'s answer to this question to create a couple plots side by side. I want to export the plots rasterized to a png. However, when I ...
3k views

How can I scale tick marks without scaling my function?

Take this plot for instance: It shows power in W, but I'd like to see it in µW, so that I get 200, 400, 600,..., which is much more readable. Is there a way to do this without scaling my ...
76 views

MatchQ failing in some cases with Hold [duplicate]

Could someone clarify why the first of these MatchQ finds a match whereas the second does not? (I'm using version 10.0, in case that matters.) ...
165 views

Recognize physical constants?

Is there some way to ask Mathematica to recognize physical constants, such as 32 or 9.81 (gravitational acceleration, in different units, at Earth's surface)? I have in mind something like the ...
181 views

How to read the intersect corodinate of two lines from the ListLinePlot?

Suppose I have two curves intersect at some point, how can I read the coordinates from the graph, not read by eye, but find it with more precision by computer. For example, here are two lists created ...
385 views

A bug fix to mathematica 10.0.1.0

There is a bug in the Wolfram Symbolic Transfer Protocol Development in C (Windows). I described it in the next answer by myself, from which I summarize: One cannot successfully compile the ...
607 views

Finding minimal distance between two surfaces

This code will display two parametric surfaces: ...
829 views

Computing Gaussian curvature

Can Gaussian curvature $K$ be computed from WolframAlpha or any other available Mathematica program? Please indicate the program or its reference. If input ...
496 views

Using compiled function inside NMinimize

Consider this code: ...
847 views

Circular membrane vibration simulation

I'm new in Mathematica and I'm trying to simulate the vibration of a circular membrane for math project but I don't even know how to start. The wave equation describes the displacement of the ...
256 views

How to change the aspect ratio with drawing tool?

I'm drawing an image in editing an slide show with the drawing tools. But the aspect ratio of the created drawing seems fixed and not changeable with mouse dragging the border and corner as in other ...
388 views

How to change front end setting “Parallel Kernel Configuration” in the code?

I'm trying to run Mathematica parallel on multiple nodes on a HPC, and I use the remote kernel tab in the "Parallel Kernel Configuration" settings to set the communication between different ...
528 views

Listing matrices up to symmetry

I am interested in the equivalence relation on N x N binary matrices, in which two matrices are equivalent if one can be obtained by rotating/reflecting the other. I would like to obtain a list ...
819 views

ItoProcess function

While looking in the help manual of Mathematica concerning the ItoProcess function I found the following: ItoProcess[{a,b,c},x,t]: represents an Ito Process y(t)=c(t,x(t)), where ...
588 views

Summation with constraints

I am trying to do the summation shown below, $\sum_{i_1=0}^{imax_1} \sum_{i_2=0}^{imax_2} \dots \sum_{i_k=0}^{imax_k} f(i_1,\dots,i_k)$ $k$ is a variable. Therefore $i$ and $imax$ are defined as ...
708 views

Analytically solve the eigenvalue problem with infinite dimensions by Mathematica?

If I am given a symbolic expression of all the matrix elements in an infinite-dimensional space, e.g., the Hamiltonian of a quantum mechanical system, is it possible to get the symbolic expression for ...
1k views

Classifying poker hands by pattern matching

I am working on this question posed in a Mathematica course revised in 1998. Here are the instructions: Poker Hands You are to define and show working examples of a function "...
285 views

How can Private functions be made completely opaque?

I want to make Private functions. From my point of view, being a Private function means that the function is not accessible from other packages. For that purpose I wrote the following code. But my ...
2k views

How to fix BodePlot that comes with Mathematica?

I am using Mathematica to go through the examples and exercises on the book Modern Control Systems, 6th edition by Dorf. On page 605, there is a table (Table 8.5) with the Bode plot for several ...
2k views

Reading in scientific notation from C++ to Mathematica

With a text file with entries formatted as (output from C++): f[38.67] = -2.5387862698183892298317350539374412777263289550697e-05; ⋮ Is there a way to read this ...
1k views

Define a color function based on color samples obtained from ColorBrewer

I am quite new to mathematica and I am searching for a way to create a smooth colormap based on the samples given by http://colorbrewer2.org/ . Is it possible to create a interpolated function from ...
412 views

Custom (physics) dictionary for mathematica (used for word-processing, spell checking)

Is there a dictonary available that contains physics slang like spinor, vacua, gauge etc.?? How would one integrate such a file (or a simple text file containing the words) into the front-end without ...
608 views

How could I get the value of y[t] at each specific interpolation point?

sol = NDSolve[{Derivative[2][y][t] + Sin[y[t]] == 0, Derivative[1][y][0] == 0, y[0] == 1}, y, {t, 0, 2}] the above-mentioned differential equations can be solved ...
1k views

Replace function and its derivatives found with Solve

If I have an equation eq = f[x] + g[x] == 0 and I solve for f[x] sol = Solve[eq,f[x]] ...
1k views

GridLines in LogPlot or LogLogPlot

Suppose I have a plot like LogLogPlot[2 x^5/3, {x,0.1,10}, GridLines->Automatic] How can I achieve to get "custom" gridlines to reduce the number of ...
88 views

Share a method to patch the discontinuous line in a image

Similar to this post which I have posted before(How to patch fingerprint ridges),Its solution's level higher than my expectation.So cost my these days to research this.Now I'm glad to share my fruit ...
242 views

How can I capture a rectangular area from an image?

I am looking for a method to extract rectangular areas from an image. The image is divided up into rectangular problem spaces like the image shown below. Each numbered problem is given with some text ...
221 views

Convert C program using mathlink to WSTP

I have been using heavily a custom frontend to mathematica based on mathlink. I derived it from http://library.wolfram.com/infocenter/Demos/174/frontend.c?file_id=4692 . I just learned that mathlink ...
486 views

How to dequantify units in mathematica?

Is there a function which applied to a quantity returns its numerical value so I for instance can fill it into my Predictorfunction?
237 views

Export ContourPlot as DXF

I'm having some trouble exporting a ContourPlot as a .DXF (to be used in AutoCAD). My code is: ...
76 views

Formatting All Appropriate Output as Desired Automatically

I want to output in MatrixForm whenever I have a list/vector/matrix, but I do not want to have to type out the command each time. How can I write one command at ...
I am currently running Mathematica 8 and I would like to know how to define custom operators. Let's say I define an operator called $\times$ where: $$a\times b = a+a\cdot b+b$$ I also want to know ...