Efficiently Store Mathematica Output as Vector: A How-To Guide

  • Context: Mathematica 
  • Thread starter Thread starter confused_engineer
  • Start date Start date
  • Tags Tags
    Mathematica Output
Click For Summary
SUMMARY

The discussion focuses on efficiently storing the output of the Mathematica function Roots applied to the Legendre polynomial LegendreP[3.0, x]. The solution provided involves using the ToRules function to convert the output into a vector format. This method successfully captures the roots of the polynomial equation and presents them in a structured manner. Participants confirmed the effectiveness of this approach, ensuring clarity in storing mathematical outputs.

PREREQUISITES
  • Familiarity with Mathematica programming language
  • Understanding of polynomial equations and roots
  • Knowledge of the Legendre polynomial family
  • Experience with data structures in Mathematica
NEXT STEPS
  • Explore advanced Mathematica functions for data manipulation
  • Learn about the properties and applications of Legendre polynomials
  • Investigate other methods for storing mathematical outputs in Mathematica
  • Study the use of rules and associations in Mathematica for data organization
USEFUL FOR

Mathematica users, mathematicians, and researchers who need to store and manipulate polynomial outputs efficiently.

confused_engineer
Messages
34
Reaction score
1
Hi.

I want to store the output of Roots[LegendreP[3.0, x] == 0, x] as a vector.

Can someone help me?
Thanks
 
Physics news on Phys.org
confused_engineer said:
Hi.

I want to store the output of Roots[LegendreP[3.0, x] == 0, x] as a vector.

Can someone help me?
Thanks
Try
Code:
{ToRules[Roots[LegendreP[3.0, x] == 0, x]]}
 
  • Like
Likes   Reactions: confused_engineer
Yes, this seems to work. Thanks.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K