All Questions

Filter by
Sorted by
Tagged with
4 votes
2 answers
929 views

Extracting a single layer from a SHP file

I have an ESRI ShapeFile (SHP) that I've loaded. It has a number of layers which I can see the names of by using: Import["file.shp", "LayerNames"] I get ...
ShaunLangley's user avatar
8 votes
2 answers
948 views

How do I remove the subscript after calling BaseForm?

Say I want to convert some number $N$ to base $k$. Here, I might use the command BaseForm[N,`k], e.g., BaseForm[10,`2] which ...
MultiVerb's user avatar
49 votes
4 answers
32k views

How to remove redundant {} from a nested list of lists?

There are numerous examples here, whose end result is the removal of empty brackets {} and empty lists. I still can't find an example of simply removing redundant ...
mystackexchangeusername's user avatar
4 votes
2 answers
420 views

How to change the last plotstyle of a list

I'm using ListLinePlot to plot a list containing 10 lists, using the default colors: ListLinePlot[myList] I would like to be able to keep the default PlotStyle ...
Sulli's user avatar
  • 2,205
1 vote
3 answers
793 views

Separate an array in two arrays, the even and odd terms being separated in these two arrays

How can I separate the odd terms in one array and the even terms in another array,i.e., go from a={1,2,3,4} to aeven={2,4} ...
Mencia's user avatar
  • 1,344
-4 votes
3 answers
315 views

How can I draw this plot?

How can I draw a plot like this one? I want to be able to specify the x-axis, y-axis, and z-axis ticks and the number of bars in the plot.
niren's user avatar
  • 743
9 votes
1 answer
298 views

Converting to InputForm or StandardForm without deleting comments

Following on from this question: Is it possible to convert an expression to InputForm or StandardForm without losing the comments? For example, ...
geordie's user avatar
  • 3,693
0 votes
2 answers
13k views

How can I make a transparent 3D Rectangle?

Sorry, I didn't mentioned clearly in my earlier post. I want to build a transparent Rectangle, within which I want to diffuse a certain color of my choice which is ...
subbu's user avatar
  • 2,304
2 votes
1 answer
281 views

Mathematica 9.0 problem: ParallelTable with SQLExecute

I have run into the following problem: when I try to run the following code in Mathematica 9 I get SQL connection error on all kernels. The code is: ...
Vajk's user avatar
  • 63
1 vote
0 answers
196 views

Better alternatives for the Sound function?

The Sound function represents the sound signal very primitive in my opinion. There are only two buttons (play and pause). No rewind, no playing from some point on (like the most sound players have). ...
kornaros's user avatar
  • 1,047
10 votes
1 answer
1k views

Proper use of arbitrary number of variables

So, I'm working on a project where the number of independent variables is not fixed. Consider a problem of $N$ independent variables, $\boldsymbol{r}$. I want to perform different things with them. ...
Jorge Leitao's user avatar
3 votes
6 answers
448 views

Subtract more than one array using DeleteCases

I need to create an array subtracting two arrays from another array. I know how to subtract one: am = DeleteCases[amp, Alternatives @@ af] I can subtract an ...
Mencia's user avatar
  • 1,344
0 votes
1 answer
94 views

How to get a number, but not a list, of the dimension of your array?

I need to use the dimension of a certain array, to use it as a bounder in a loop afterwards. The problem is that I get a list, when write : ...
Mencia's user avatar
  • 1,344
-2 votes
1 answer
875 views

Non-regular grid data

I have issue with non-regulary spaced data. I have set of 3 numbers {x, y, z} in my list. ...
Bob's user avatar
  • 1
4 votes
1 answer
235 views

How can I write image to MySQL database?

I have a database, such as: In Mathematica, the final code is: img1=Export["/home/user/Desktop/1.jpg",resultimg1]; I tried ...
Darren Lee's user avatar
4 votes
2 answers
536 views

Updating the format style of input cells from an older/'pre-styled' notebook

I have been given a large notebook that was created in mathematica 6. It contains a structure of sections and subsections and the input text is formatted in an unusual (possibly just old) style (see ...
geordie's user avatar
  • 3,693
3 votes
1 answer
5k views

Executing a .m file from the Linux command line

I have some code in a file named Demo-3.m, It can be evaluated in Mathematica 9. The final expression in the file is ...
Darren Lee's user avatar
0 votes
0 answers
99 views

NIntegrate, view integration options [duplicate]

The Mathematica manual says: NIntegrate symbolically analyzes its input to transform oscillatory and other integrands, subdivide piecewise functions, and select ...
molkee's user avatar
  • 899
6 votes
2 answers
873 views

Histogram3D using sums instead of counts

I'm trying to create a 3d histogram/ matrix plot pair. My data is in the form {{TTR1,TBF1},{TTR2,TBF2},....} What I would like is to modify the Histogram3D so ...
Cam's user avatar
  • 1,596
2 votes
3 answers
623 views

Plotting many tables in a single plot

I have several lists. ...
Milo Gertjejansen's user avatar
-9 votes
2 answers
779 views

Color plot markers using If statement

I am calculating eigenvlaues. Some are negative, some are positive. I define the index nn and mm (as well as np and mp) of each matrix element by some functions that assign positive, zero and negative ...
Rainforest Frog's user avatar
2 votes
5 answers
8k views

Loop through a list and select elements

I am new to Mathematica and I have no idea how to make a basic for loop work. I want to loop through the elements of a list: Range[45, 200]. I want to select the ...
edferda's user avatar
  • 123
6 votes
3 answers
285 views

How to make a plot of function over 24 orders of magnitude?

Assume these parameter definitions first: ...
Cendo's user avatar
  • 681
5 votes
0 answers
499 views

Listing over multiple inputs (tensor rank > 1) in a compiled function

I'm trying to optimize the solution given by Michael E2 to my previous problem (Efficiently determining if 3D points are within a surface composed of polygons) which I figured would be relatively ...
s0rce's user avatar
  • 9,632
13 votes
8 answers
2k views

How to dynamically toggle curves on/off in a crowded Plot?

When multiple curves appear in a single plot, it is useful to interactively turn certain curves on or off to visually compare smaller numbers of curves. It is trivial to put a quick dynamic together, ...
Daniel W's user avatar
  • 3,426
6 votes
1 answer
751 views

Include a CDF file in sites.google

I have a website on sites.google and I also have blog on wordpress. I would like to include some CDF files on them. How can it be done?
lovespeed's user avatar
  • 327
6 votes
3 answers
644 views

The same value of VertexSize for vertices in different graphs causes different vertices size

I generated some graphs. The smallest vertices in the 1st graph should be the same size as the smallest vertices in the second graph. The smallest vertices have the same size (...
Bartek's user avatar
  • 433
16 votes
1 answer
10k views

Properly Force Mathematica to Simplify Log Expressions/Rules

I want to be able to expand $\log(x^n e^x) = n \log(x) +x$: FullSimplify[Log[x^n Exp[x]], x > 0 && Element[n, Integers] && n > 1] yields <...
nick maxwell's user avatar
28 votes
4 answers
9k views

Efficiently determining if 3D points are within a surface composed of polygons

This is the 2nd part of a previous question which I edited to make into 2 separate questions: Extracting polygons from 3D contour plot surface As an extension of my earlier question involving simple ...
s0rce's user avatar
  • 9,632
20 votes
5 answers
39k views

How to plot an ellipse?

I'm new to Mathematica, and I'm finding it difficult to plot an ellipse. I tried using Plot[(x/5)^2 + (y/3)^2 == 1, {x, -5, 5}, {y, -3, 3}] but I'm getting ...
Sriram's user avatar
  • 201
18 votes
1 answer
2k views

Quiet doesn't work with FindRoot when using Brent method

Bug introduced in 9.0.1 or earlier and persisting through 12.3.1 or later The following has no solution: FindRoot[x == 1, {x, 0.25, 0, 0.5}] And Mathematica ...
P. Fonseca's user avatar
  • 6,675
4 votes
1 answer
457 views

How to accelerate updating some parts of sparse matrices?

I am trying to update some parts of an specific matrix as rapidly as possible. In what follows, I first set up the basics things that I want to use ...
M.J.2's user avatar
  • 491
5 votes
2 answers
307 views

How to make DynamicModule work without an extra ENTER

I've been trying to learn more about DynamicModule (I do not use them, as I used Manipulate all the time). After some time ...
Nasser's user avatar
  • 145k
24 votes
7 answers
6k views

Distance between point and line segments

How would you determine the shortest distance between a point and one or more segments? For example, what is the shortest distance between the point and the two segments below? Clearly the point is ...
sjdh's user avatar
  • 7,777
8 votes
2 answers
3k views

What is wrong with my VectorPlot?

I am trying to make a simple plot of a spherical field falling off with distance from origin: ...
Rob N's user avatar
  • 183
2 votes
3 answers
4k views

Controlling Bar Color in BarChart precisely [duplicate]

I'm trying to control the color of individual bars in a BarChartwhen I pass a 2 dimensional list of data to plot. What I want to accomplish is that for each pair of ...
s0rce's user avatar
  • 9,632
3 votes
3 answers
433 views

How to deal with units in logarithms?

I'm trying to take a formula, take it's integral which yields a formula with logarithms, and then directly plug in values with units and get an answer. However if the units go into any of the ...
dmikalova's user avatar
  • 263
5 votes
2 answers
752 views

Why does the syntax highlighter color a local symbol red inside DynamicModule?

I am adding a Module inside DynamicModule here is an example (thanks to @rm-rf for this simple example) ...
Nasser's user avatar
  • 145k
5 votes
1 answer
321 views

WolframAlpha Selective SubPod Content

I am sending queries to Wolfram | Alpha from Mathematica V9 and and importing the results back into Mathematica, but I am running into a challenge in formatting the request. Specifically, I would like ...
Nguyen Van Falk's user avatar
5 votes
2 answers
3k views

Plotting 2D Data with Categorical Data in One of the Dimensions

I have a 2D data set in the form of: data={{Category, Integer}, {Category, Integer},{Category, Integer}...} It is a pretty simple data set with four categories ...
Nguyen Van Falk's user avatar
22 votes
2 answers
1k views

Efficient Generation of Random Variates from a Copula Distribution

I have a 7-asset portfolio for which I want to simulate daily log-deltas using a Student T copula. The marginal distributions are all either Stable or TsallisQGaussian. Using NMaximize, I have ...
user6062's user avatar
  • 321
0 votes
0 answers
109 views

how to interactively select points inside certain region in a plot [duplicate]

Very often I encounter a situation that I want to select some points inside certain areas of a plot. For example, ...
xslittlegrass's user avatar
1 vote
2 answers
202 views

How to use SaveDefinitions when using Rasterized Frames for a ListAnimate?

In another post (Is it possible to prerender animation in Wolfram Mathematica?) I got a good way to prerender frames in order to get a smooth animation using ListAnimate. I need to save the Animation ...
pedroamv's user avatar
1 vote
0 answers
50 views

Define a second name for a function [duplicate]

I'm working with an own package of functions. During development I noticed, that my naming scheme is not that clever; for example some of my functions are starting with capital letters. But I have ...
Ronny's user avatar
  • 1,141
4 votes
1 answer
280 views

Print out all functions in Mathematica

Sometimes I only remember parts of a function name and I want find that function name quickly, and if I search in the document center, it will give too much informations related to that and difficult ...
user0501's user avatar
  • 2,380
35 votes
8 answers
2k views

How do I get my equation to have the form $(x-a)^2 + (y-b)^2 + (z-c)^2-d = 0$?

I want Mathematica to express the equation $$-11 - 2 x + x^2 - 4 y + y^2 - 6 z + z^2=0$$ in the form $$(x - 1)^2 + (y - 2)^2 + (z - 3)^2 - 25=0$$ How do I tell Mathematica to do that?
minthao_2011's user avatar
  • 4,513
6 votes
2 answers
7k views

How do I make function A create and return function B?

My basic need is I have to take lots of data and other information and assemble it into a function (static parameters). I then need to call the function many times for numerical results for many ...
c186282's user avatar
  • 1,402
3 votes
5 answers
2k views

How to combine some elements of a list?

In order to simplify my expression, I face a list manipulation problem. For example, given the input list ...
Orders's user avatar
  • 1,247
3 votes
1 answer
756 views

My Data has negative and positive numbers, can I still use it to get the PDF?

I have data that reflects the arrival time of a flight. {3, -2, 16, 13, -6, 5, 4, -7, 7, 0……..n} this is for 8:45am and has 150 elements "arrivals" The positive values represent the time in minutes ...
Bob Brooks's user avatar
5 votes
1 answer
408 views

Is there a way to track the Simplify process?

Is there any way to track how Mathematica actually performs Simplify, so that we can see what those "Automatic" transformation functions it applies are and how it ...
user0501's user avatar
  • 2,380

15 30 50 per page