Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6942431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:00:56+00:00 2026-05-27T13:00:56+00:00

I am having some slight difficulty with the following code: Lagrange[list_] := Module[{points =

  • 0

I am having some slight difficulty with the following code:

Lagrange[list_] := 
  Module[{points = list, length, k, j, m, x, g}, 
    length = Length[points]; 
    k = length - 1; 
    f = Sum[points[[j + 1,2]]*Product[If[j != m, (x - points[[m + 1,1]])/
          (points[[j + 1,1]] - points[[m + 1,1]]), 1], {m, 0, k}], {j, 0, k}]; 
    g = FullSimplify[Expand[f]]; 
    Return[f]]

The output I get is:

Out[101]= 0. -1.85698 (-1.5+x$26810) (-0.75+x$26810) (0. +x$26810) (0.75+x$26810)
         +0.490717 (-1.5+x$26810) (-0.75+x$26810) (0. +x$26810) (1.5 +x$26810)
         -0.490717 (-1.5+x$26810) (0. +x$26810) (0.75 +x$26810) (1.5 +x$26810)
         +1.85698 (-0.75+x$26810) (0. +x$26810) (0.75 +x$26810) (1.5 +x$26810)

My concern is with these “$” symbols. I don’t know what they mean, I can’t find documentation on them, and they are preventing the plotting of this polynomial.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:00:57+00:00Added an answer on May 27, 2026 at 1:00 pm

    The $ in your output is from the unique variable generated by the lexical scoping of Module (see the More Information part of mathematica/ref/Module). This is why I made my LagrangePoly function accept the symbol that the polynomial is meant to be in. I used LagrangePoly[list_, var_:x], which defaults to the global symbol x.

    A simple example of the problem is

    In[1]:= Module[{x}, x]    
    Out[1]= x$583
    

    The number in the “local” variable x$nnn comes from the global $ModuleNumber.

    If you don’t understand this, then you should probably read the tutorial Blocks Compared with Modules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some slight problems with fading one div into another, here's my code
im having some difficulty trying to pull out a specific value from a cookie.
Having some difficulty understanding the best way to implement subclasses with a generic repository
Having some trouble with some SQL. Take the following result for instance: LOC_CODE CHANNEL
Having some issues running my code local. I have host file setup like this:
We're having some slight problems with our Zebra striping implementation. While it displays alternating
Having some pain with this event, I have some code like this for a
I am having a slight problem with this piece of code as I am
I'm having a slight terminology meltdown as I design some classes. In Sql Server
Having some issues getting my head around the differences between UTF-8, UTF-16, ASCII and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.