4
votes
2answers
139 views

Equivalent of __FILE__?

Many languages define a special identifier whose value is the path to the source file currently being processed. (For example, in C, this is done through the ...
0
votes
1answer
126 views

Question with ParametricNDSolveValue

When solving the following system: ...
2
votes
0answers
65 views

How to create a ListPlot containing two lists? [duplicate]

I'm trying to plot a set of points where one list corresponds to the X values another list corresponds to the Y values. I have ...
5
votes
2answers
276 views

Building conditional lists with Manipulate

I'm trying to select elements of a list that satisfy some criteria using Manipulate[]. Given 2 lists: ...
1
vote
1answer
121 views

Exporting a histogram to PDF in without rasterising it

How can I export a histogram without rasterising it? The labels and axes seem unaffected, but the bars themselves are pixelated when I zoom into them in a PDF viewer. For example, if I run ...
29
votes
3answers
1k views

Getting serious about Mathematica programming

I'm at a point in my Mathematica journey where I need to be a little bit more strategic about my coding. Presently, I have a bunch of notebook files organized using the filesystem of the OS and ...
2
votes
1answer
1k views

Having Problem with Importing Excel file to Mathematica Notebook?

I have solved some equations and exported the final results, which they are several Matrices, as a EXCEL file ( .Xls ). Now, I want to use these EXCEL files as my inputs to solve some other equations. ...
7
votes
1answer
133 views

What should I call the messages that appear when the mouse moves over failed graphics output?

I attempted to evaluate the following Plot[x^2, {x, 1, 2}, PlotStyle -> {RGBColor[a]}] which, of course, failed. After the failure, putting my mouse over the ...
15
votes
2answers
314 views

MathKernel doesn't return all Messages

In Mathematica I run this command: Plot[Sin[x], {x, 1, 15}, GridLines -> error] It generates a Plot with this error message: A GridLines specification ...
6
votes
1answer
139 views

Replace content of selected cells, each getting different new content

Let's say I select 2 different cells and then attempt to replace their content using NotebookWrite inside a button. How might I replace each cell's content ...
1
vote
1answer
150 views

Behaviour of Locator

I seek advice regarding the constrained behaviour of the Locator: appears confined to square {0,0}->{1,1}. When I change starting position it snaps to this constrained region. The code I am referring ...
0
votes
1answer
119 views

Why do I get a different answer from the use of TrigExpand?

This is an old post but I get two different answers from Mathematica 9.0.1.0 ...
0
votes
1answer
382 views

Projecting on an arbitrary plane

I have the following code, giving me a representation of a photon hitting a cylinder: ...
3
votes
3answers
185 views

Renaming a list with name obtained interactively

I have a list say: m = {1, 2, 3} The list is inside a package, and is the result of a calculation. I want to give the user the option to rename it, for example ...
1
vote
1answer
111 views

NotebookWrite Multiple Selected Objects

Lets say I select shapes in a Graphics diagram in the following picture. Generated from the following set of code: ...
3
votes
1answer
169 views

Isolate a specific contour without Contour Shading

I have a contour plot that took a few hours to evaluate. Is there a way that I can show only the contour lines of a specific value without re-evaluating the contour plot?
-1
votes
1answer
110 views

Plotting a function dependent on $x/d$

I have a problem in plotting a function. The example code is as following: ...
11
votes
2answers
309 views

Clever use of DownValues, or failure to understand the “Mathematica Way.”

I needed to look at the changes in the values of about 4000 items from one year to the next. I have a table with identifiers and values for each year. Not all of the items are in each list. The ...
0
votes
1answer
307 views

Solve equation containing conditions (If expressions)

I want to solve the underneath equation. If I try Solve[AAA,dc], then I get no solution. Can anybody explain this? ...
4
votes
2answers
366 views

Using Greek letters with subscripts as symbols

I'd like to use Subscript[ϕ, 1] as a function name: Subscript[ϕ, 1][x_] = C1 + C2*x + C3*Exp[α*x] + C4*Exp[-α*x] But as I use ...
4
votes
3answers
377 views

Using subscript in a string

I am trying to create a string of the form $0 < d_1 < d_2 < \ldots < d_n$ For a given n. My closest attempt so far is ...
9
votes
1answer
239 views

$1 - \sqrt{5}$ $\in$ $\mathbf{R}$?

Why is there a difference in the output of the following codes? First: ...
0
votes
4answers
1k views

Problem with plotting legends using the PlotLegends package

Here is my problem : I have a table composed of 3 "under"-Lists and I'd like to plot it with legends, but I can't find a way to do it. ...
1
vote
1answer
156 views

plot probability

Hi I just want to flatten a function, I tied it with Joined->True, but it did not work, hope somebody of you can help me. This is my code: ...
1
vote
1answer
135 views

Problem about Solve

See this example : ...
1
vote
1answer
77 views

Aborting a computation correctly in .NETLink to allow future computations

Has anyone had any success using the AbortEvaluation() function in IKernelLink to stop a computation and then do more ...
0
votes
1answer
184 views

find derivative with defined function

s[a_, b_] := NDSolve[{y''[x] == y[x] Cos[x + y[x]], y[0] == a, y'[0] == 1}, y, {x,0, b}] I need to find the minimal of $\int _1^by[x]^2$ in the region ...
1
vote
2answers
421 views

How to define a function based on the output of DSolve? [duplicate]

I would like to define a function based on the output of the following DSolve call: ...
5
votes
2answers
149 views

Short circuit logical operators [duplicate]

Suppose I want to compute $f(1)\vee f(2) \vee \ldots \vee f(10^{10})$, but I know a priori that $f(n)$ is True for some $n \ll 10^{10}$ with high probability. For ...
7
votes
1answer
154 views

Specifying optional arguments with variables

Perhaps this is poor programming on my part, but I would like to create a function that uses a variable as an optional parameter: var = 2; f[a_:var] := {a} The ...
1
vote
2answers
143 views

Lists not being recognized correctly within manipulate

I've created a keyboard-free panning system within Mathematica. The code does the job, but I continually get errors in relation to it, and I cannot seem to get it to perform within a CDF because of ...
5
votes
1answer
310 views

Altering layout and sizing of Manipulate controls?

I'm currently working on a display project using Manipulate and was wondering if there is a straightforward way to alter the placement of the control options that I ...
-4
votes
1answer
228 views

findroot, derivative in defined functions

I apologize for my unclear question, I will write it in a more detailed way. I first define: ...
2
votes
2answers
272 views

Intersection & Complement operations for lists of Morphological Components?

I have an array of $M$ sets of morphological components corresponding to the same image, however computed in different ways. For example, we might have: ...
21
votes
1answer
371 views

Why does list assignment with a packed array result in unpacked values?

This is another question on the design choices in Mathematica. I understand that without direct reply from the developers it may not be possible to give a definitive and exhaustive answer to "why" ...
6
votes
3answers
484 views

Opacity and overlapping multiple polygons

Let's say I have 100 polygons that are all different but most of them overlap. All I want to do is to draw/plot them in one single graphic with linearly adding gray values; i.e., a point with ...
3
votes
1answer
387 views

Looking for equivalent of MinorTicks->None

I am looking for the most general possible way to suppress the display of minor ticks in Mathematica plots.1 More specifically, I'm looking for the equivalent (or near-equivalent) of a fictional ...
1
vote
1answer
174 views

Averaging multiple 2D data sets

I have multiple data sets, each of which is a 2D matrix. I want to construct a new 2D Matrix in which each element is the average of that element for all the original data sets. i.e ...
3
votes
1answer
727 views

How can I run .exe file in Mathematica

we have a .exe file. It takes input as .txt file and gives output as another .txt file. ...
3
votes
1answer
1k views

Finding intersection of two graphs

Here is a toy problem: I have a (directional) line that starts from {2,0} and goes through {1.8, 0.01}. Also I have a ...
5
votes
2answers
234 views

Overlapping pure functions

Let say I need and option for Plot: RegionFunction -> (-6 < #2 < 6 &) But I also want those ...
6
votes
1answer
1k views

Possible to export Excel formulas?

I would like to export an .XLS file complete with data and formulas. Is this possible using Export? For example, here is data and a formula :- I can import ...
2
votes
0answers
67 views

Can I evaluated a cell in a notebook in a background process?

I currently run my Mathematica on a linux computer through Putty and Xming. Xming provides a graphical display for Mathematica windows running on a remote linux computer. But recently, the network ...
-5
votes
1answer
255 views

Split dataset based on the first column [duplicate]

I have a dataset which I want to split based on the first column. The data looks like this ...
0
votes
1answer
136 views

Plotting boundary value expression against a parameter

I am very new to Mathematica and have a question regarding plotting a ODE boundary value problem. Let say I have an ODE ...
3
votes
3answers
235 views

TransformedDistribution doesn't work

I'm trying to obtain a sum distribution of two discrete random variables. The function TransformedDistribution doesn't work for me in such case: ...
1
vote
1answer
167 views

Extracting values

I have imported a data from an excel sheet. I want to extract parts of the list based on some conditions. First I want to create one list whit the The Coca-Cola ...
2
votes
2answers
572 views

How to set the ratio between the vertical and horizontal scales of plots?

The documentation says that when AspectRatio->Automatic is specified, Mathematica determines the ratio of height to width from the actual coordinate values ...
3
votes
0answers
97 views

CCodeGenerate and calling external functions

Is it possible to use CCodeGenerate to generate code which calls functions from other C libraries? For example, I would like to do something like this: ...
3
votes
1answer
351 views

Matching parentheses size in plot labels

I am attempting to do a seemingly-simple task: label ordered pairs in a Plot that display with parentheses that grow to match the expression within. I've trawled ...

15 30 50 per page