0
|
3853 Views
|
8 Replies
|
2 Total Likes
View groups...
Share
GROUPS:

# i want to transfer function to programming by mma!!

Posted 10 years ago
 but i am user,i need help!! can anyone help me to write this code?
8 Replies
Sort By:
Posted 10 years ago
 Always best to show what you did when you post such a question.
Posted 10 years ago
 hi, this is not homework obviously.i practice lagrange Polynomial but i have trouble , so i just post my question!!
Posted 10 years ago
 What have you tried? (I don't imagine anyone will just write up homework code unless there is some sign of effort on your part).
Posted 10 years ago
 Ups, sorry. I believe I just did...M.
Posted 10 years ago
 (That cracks me up..)
Posted 10 years ago
 Some folks just can't help themselves... ;-)
Posted 10 years ago
 sir ,you can take it easy,this is not my homework ,i write some finite elements method and i have problems,so i post it
Posted 10 years ago
 Hi, I do not know how to do that in an elegant way, but I noted that this Product[i, {i, Complement[Range[1, 4], {3}]}] is a way to exempt certain indices (in this case 3) from the product. In oder to evaluate the products we need to fix i. In my example Manipulate does that for us. Manipulate[ Product[Subscript[x, j] - Subscript[x, i], {j, Complement[Range[1, 3], {i}]}]/ Product[Subscript[x, i] - Subscript[x, k], {k, Complement[Range[1, 3], {i}]}], {i, 1, 3, 1}] You can also get the results for different $i$ in form of a table: Table[Product[ Subscript[x, j] - Subscript[x, i], {j, Complement[Range[1, 3], {i}]}]/ Product[Subscript[x, i] - Subscript[x, k], {k, Complement[Range[1, 3], {i}]}], {i, 1, 3}] which results in:I am sure that there is a super-easy way of doing this, but in principle the functions above should do the trick.Cheers,Marco
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.