Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.9K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Convert output to a list or a vector ready to be used in ListPlot[]?

Posted 9 years ago

Honest,

you are trying to convert a list of rules, such as

listOfRules = {x->2, y->3}

into a simpler list {x, y}, with x and y replaced, if I understand correctly. Two suggested approaches:

A) ReplaceAll (short notation /. ) to apply the rules to vector {x, y}:

{x, y} /. listOfRules

B) Part (short notation [[ ]] ) to extract all the second Rule arguments in your list:

listOfRules[[All, 2]]

Hope this helps, Peter

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