Group Abstract Group Abstract

Message Boards Message Boards

0
|
11K Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to display underlaying symbolic function but not calculating the result

Posted 8 years ago
POSTED BY: Lea Rebanks
5 Replies
Posted 8 years ago

Perfect Ben. Many thanks, Lea...

POSTED BY: Lea Rebanks
Posted 8 years ago

Hi Ben & All,

Further to your excellent recommendation of the use of the Defer[ ] function. I am trying to incorporate "Defer" into the following, but cannot seem to get the desired result. Please could you show the coding using Defer to get :-

    FoldList[Plus, 0, Table[data[[i]], {i, 10}]] // TableForm

0,

data[[1]],

data[[1]]+data[[2]],

data[[1]]+data[[2]]+data[[3]],

data[[1]]+data[[2]]+data[[3]]+data[[4]],

data[[1]]+data[[2]]+data[[3]]+data[[4]]+data[[5]],

data[[1]]+data[[2]]+data[[3]]+data[[4]]+data[[5]]+data[[6]],

data[[1]]+data[[2]]+data[[3]]+data[[4]]+data[[5]]+data[[6]]+data[[7]],

data[[1]]+data[[2]]+data[[3]]+data[[4]]+data[[5]]+data[[6]]+data[[7]]+data[[8]],

data[[1]]+data[[2]]+data[[3]]+data[[4]]+data[[5]]+data[[6]]+data[[7]]+data[[8]]+data[[9]],

data[[1]]+data[[2]]+data[[3]]+data[[4]]+data[[5]]+data[[6]]+data[[7]]+data[[8]]+data[[9]]+data[[10]]

instead of :- 0 24 29 20 125 140 251

Many thanks for your help. Lea...

POSTED BY: Lea Rebanks
POSTED BY: Benjamin Goodman
Posted 8 years ago

Excellent Ben. Exactly what I wanted. Many thanks for your help, Lea...

POSTED BY: Lea Rebanks

Hi,

Table[With[{i = i}, Defer[data[[i]]]], {i, 1, 6}]

returns what you need where the resultant list

{data[[1]], data[[2]], data[[3]], data[[4]], data[[5]], data[[6]]}

evaluates to

{24, 5, -9, 105, 15, 111}

A great primer on programmatically creating expressions http://community.wolfram.com/groups/-/m/t/1121273

Some other cases of using With[{i=i},...]

[https : // reference.wolfram.com/language/howto/ EvaluateExpressionsInsideDynamicOrManipulate.html][2]

https://mathematica.stackexchange.com/questions/141596/differentiate-values-inside-table-using-dynamic

POSTED BY: Benjamin Goodman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard