Mathematica Help: Automating Calculations with afindminimum Function

  • Mathematica
  • Thread starter srik
  • Start date
  • Tags
    Mathematica
In summary, the speaker is looking for a way to automate their calculations by using the function afindminimum to find a minimum value. They currently have to copy and paste the value of a to define it, but they want to be able to extract just the number after the arrow from the result of afindminimum. They have tried using Take and Extract, but have not been successful. They ask if using % will work, but it only gives them the entire result in brackets.
  • #1
srik
2
0
I've got a very simple problem, but I don't really know that much code. I want to automate my calculations. The function afindminimum finds a minimum value, a. I then need that value a to continue. What I'm doing right now is copy-pasting the a to define it. But I want something that takes it out of the result for afindminimum, so that I don't have to copy-paste every time.

http://i2.photobucket.com/albums/y22/srik/math1.jpg

I can extract the second part like this:

http://i2.photobucket.com/albums/y22/srik/math2.jpg

But I want just the number, the thing after the arrow. I don't think Take or Extract or whatever are helpful here. So how then?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Can you just use % to carry the previous answer forward?
 
  • #3
nope, that just gives me the whole thing in the {} brackets
 

Related to Mathematica Help: Automating Calculations with afindminimum Function

1. How can I extract a specific element from a list in Mathematica?

To extract a specific element from a list in Mathematica, you can use the Part function. For example, if you have a list named "myList" and you want to extract the third element, you can use myList[[3]]. This will return the third element of the list.

2. Can I use Mathematica to extract data from a text file?

Yes, you can use the Import function in Mathematica to extract data from a text file. You can specify the format of the file and the specific data elements you want to extract.

3. How do I extract multiple elements from a list in Mathematica?

To extract multiple elements from a list in Mathematica, you can use the Part function with a range of indices. For example, if you want to extract the first three elements of a list, you can use myList[[1;;3]]. This will return a list with the first three elements.

4. Is it possible to extract data from a plot in Mathematica?

Yes, you can use the PlotPoints function in Mathematica to extract data from a plot. This function will return a list of points that make up the plot, which you can then manipulate or analyze further.

5. How can I extract specific elements from a nested list in Mathematica?

To extract specific elements from a nested list in Mathematica, you can use a combination of the Part function and the Map function. The Map function allows you to apply a function to each element of a list, while the Part function allows you to extract specific elements. By using these functions together, you can extract specific elements from a nested list.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
21
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Programming and Computer Science
Replies
1
Views
692
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
Back
Top