Message Boards Message Boards

0
|
2747 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Map function with deep level specs?

Posted 5 years ago

Hello,

I'm trying to replace the complex coefficients with their real parts in a rational function. So, these coefficients are nested sort of deep in the function. So if the function is, say, dtf, then I'd say something like

Map[Re[#]&,dtf, { {1}, {2,1,1}, {2,1,2,1}, ..., {2,1,8,1} } ]

But Mathematica says that the statement is in error because the level spec does not conform to the standard level specifications. Those only go to {n1,n2}. So, How does one accomplish a mapping for a deeply nested structure? Thanks.

POSTED BY: Roger B
2 Replies
Posted 5 years ago

See MapAt.

POSTED BY: Rohit Namjoshi
Posted 5 years ago

Thank you! That worked. :)

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

Group Abstract Group Abstract