wolfram-mathematica

Generating table of contents

折月煮酒 提交于 2019-12-21 06:16:24
问题 I posted this one a couple of months ago on the Mathematica newsgroup, but got no usable response. I thought I'd give SO a try. The question was: I don't seem to be able to find the method to generate the table of contents of a Mathematica document I'm working on. Anyone knows this feauture's hideout? David Annetts pointed me in the direction of the AuthorTools, an old v5.1 utility package that's still hidden in Mathematica. However, it doesn't work on my document (v7). Any clue? Edit The TOC

reduce system of equations which is under-determined in mathematica

和自甴很熟 提交于 2019-12-21 05:51:19
问题 I obtained the folloiwng equation (as an example): {2 w11 + 3 w21 == 2 w12, w11 == 4 w12 + 3 w22, w11 + 2 w21 + w22 == 0, 2 w12 + w21 + 2 w22 == 0} And I want to determine w11, w12, w21, w22. However, simply do the following: Solve[{3 w11 + 2 w21 == 5 w11 + 3 w12, w11 + w21 == 5 w21 + 3 w22, 3 w12 + 2 w22 == -2 w11 - w12, w12 + w22 == -2 w21 - w22}, {w11, w12, w21, w22}] Because the system of equations is under-determined. I have one thought, i.e. using matrix algebra. But I need to

Create Functions to flexibly define Chart Options lists in Mathematica

别等时光非礼了梦想. 提交于 2019-12-21 05:49:06
问题 I am trying to create some functions that will avoid me to repeat plot options for different types of plot. I encounter some troubles as I try to create mechanisms to automatically handle Frameticks & Plot Range given the data considered within a given plot. Module[{chartData}, chartData = RandomInteger[20, 20]; BarChart[chartData, Frame -> {{True, True}, {True, True}}, ImageSize -> 300, ChartStyle -> Black, FrameLabel -> {{"yName", None}, {None, "xName"}}, ChartElementFunction ->

Image analysis - fiber recognition

旧城冷巷雨未停 提交于 2019-12-21 04:32:14
问题 I am new to image analysis. Do you know how to binarize this image in such a way to get the fibers only? I have tried different threshold techniques etc, but I was not successful. I do not mind what tool I should use but I prefer .NET or Matlab . PS: I did not know where to put my answer, so I put it at StackOverflow. 回答1: Based on the comments, it seems you are having difficulty translating the proposed Mathematica solutions into MATLAB. Here is my attempt: @Nakilon solution %# read image I

Mathematica RegionPlot on the surface of the unit sphere?

前提是你 提交于 2019-12-21 03:46:14
问题 I am using RegionPlot3D in Mathematica to visualise some inequalities. As the inequalities are homogeneous in the coordinates they are uniquely determined by their intersection with the unit sphere. This gives some two-dimensional regions on the surface of the sphere which I would like to plot. My question is how? If requested I would be more than happy to provide some Mathematica code; although I believe that the answer should be independent on the details of the regions I'm trying to plot.

Algorithm for picking pattern free downvalues from a sparse definition list

一笑奈何 提交于 2019-12-21 01:25:14
问题 I have the following problem. I am developing a stochastic simulator which samples configurations of the system at random and stores the statistics of how many times each configuration has been visited at certain time instances. Roughly the code works like this f[_Integer][{_Integer..}] :=0 ... someplace later in the code, e.g., index = get index; c = get random configuration (i.e. a tuple of integers, say a pair {n1, n2}); f[index][c] = f[index][c] + 1; which tags that configuration c has

Export custom formatted expressions from Mathematica

我的梦境 提交于 2019-12-20 23:47:32
问题 How can I get Mathematica to export/save/write a text file with proper Fortan77 formatting, that is, 72 columns and a continuation marker on the sixth column? I am using Mathematica to generate large and complex analytic expressions, which I then need to insert into pre-existing Fortran77 code. I have everything working correctly in the front end of Mathematica with FortranForm[] and SetOptions[$Output, PageWidth -> 72] However, I can't figure out how to get Mathematica to output correctly to

Plotting a number line in Mathematica

吃可爱长大的小学妹 提交于 2019-12-20 19:56:34
问题 I would like to plot a simple interval on the number line in Mathematica. How do I do this? 回答1: Here's another attempt that draws number lines with the more conventional white and black circles, although any graphics element that you want can be easily swapped out. It relies on LogicalExpand[Simplify@Reduce[expr, x]] and Sort to get the expression into something resembling a canonical form that the replacement rules can work on. This is not extensively tested and probably a little fragile.

Count how many different values a list takes in Mathematica

落爺英雄遲暮 提交于 2019-12-20 18:52:50
问题 I would like to get the number of different values found in a List. For example: The output for the List a={1,2,3,4,5} would be 5 whereas it would be 2 for b={1,1,1,2,2} . 回答1: Just for amusement, all the following commands also give the desired result: Length@Gather@l Length@Union@l Length@Tally@l Count[BinCounts@l, Except@0] Count[BinLists@l, Except@{}] Length@Split@Sort@l Length@GatherBy[l, # &] Length@Split@SortBy[l, # &] And many more, of course. Edit Here is a little timing experiment

Mathematica: why 3D plot remember last viewpoint/rotation made to it, even after evaluating again?

心已入冬 提交于 2019-12-20 17:26:33
问题 I find this a bit annoying. I make a 3D plot, initially it come up in the default orientation. Then, using the mouse, I rotate it some way. Now I run the command again, expecting to obtain the original shape (i.e the original orientation before I rotated it by mouse), but instead, it just gives me the same plot I have on the screen, i.e. it seems to have kept/remembered the last viewpoint in that output cell. I wanted it to go back to the original viewpoint. So, I delete the output cell to