# Questions tagged [programming]

Questions on writing non-trivial programs in Mathematica. Do not use this tag for questions on plotting/graphics or for questions on doing mathematics with Mathematica, where the focus is more on the math than the program.

1,490 questions
Filter by
Sorted by
Tagged with
106 views

### Is it possible to improve a code related with iterative closest point (ICP) algorithm?

I am trying to write a code related with ICP algorithm. The purpose of the code is matching a target data with a reference data by translational operation in XYZ axes (3-degree-of-freedom (DOF) ...
150 views

96 views

### RLink fails in Mathematica 12.2.0 Mac OS Catalina

Cannot run RLink in mathematica in Catalina. I get a failed error even though the paclet loads. Any pointers?
102 views

### Is there a better way to simulate quadratic cost MPC problems?

Question I would like to know if there is a more straightforward or a better way to simulate MPC problems in terms of code length and accuracy as compared to what I am doing. I am looking to know if ...
47 views

### Need help to understand the code

Here is the code by P. Valko and J. Abate for finding numerical inverse Laplace transform by trapezoidal's rule. Can someone willing to explain this code? I don't understand this part: ...
55 views

### help with performing operations on matrix parts inside a loop

I would like to translate the following code into Mathematica language but am having some trouble doing so: ...
135 views

### How to read value from a plot

Let's say I have plot. What is the command for getting the specific value at a point that I choose? Exampe: Plot like --I-. command(1) = 0 command(2) = 0, command(3)=1, command(4)=0
66 views

### How to set linear constraints on elements of a long list

I would like to minimize over quite large set of $a_i$ some function $f(a_1,a_2,\dots,a_n)$ subject to a set of $k$ linear constraints:  i=1\dots n: \quad a_i\ge0;\quad j=1\dots k:\quad\sum_{i=1}^n ...
28 views

### How to abort evaluation when clicking CancelButton in program with Dialog boxes?

If you run the following code you will notice when Cancelbutton is clicked, the output is an \$Abort, but it continues running the following cells, I tried different things but no one works. I want to ...
53 views

### How to improve the parallelization of the following piece of code?

I'm new to the parallelization of code. I have a code that takes so much time to run and I'm trying to parallelize it. I'm copying below the piece that I need to improve. Can someone help with the ...
226 views

### Confirm vs Throw

Version 12.2 brought us Confirm and Enclose. What's the point? Is it just that it's a slightly more convenient syntax than ...