Difference between revisions of "Intersection Command"

From GeoGebra Manual
Jump to: navigation, search
m
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|other}}
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|other}}
; Intersection[ <List>, <List> ]
+
; Intersection[ &lt;List>, &lt;List> ]
 
:Gives you a new list containing all elements that are part of both lists.
 
:Gives you a new list containing all elements that are part of both lists.
 
:{{example|1=<div>Let <code><nowiki>list = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}</nowiki></code> and <code><nowiki>list1 = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30}</nowiki></code> be two lists. <code><nowiki>Intersection[ list, list1 ]</nowiki></code> yields a new list ''list2 = {2, 4, 6, 8, 10, 12, 14}''.</div>}}
 
:{{example|1=<div>Let <code><nowiki>list = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}</nowiki></code> and <code><nowiki>list1 = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30}</nowiki></code> be two lists. <code><nowiki>Intersection[ list, list1 ]</nowiki></code> yields a new list ''list2 = {2, 4, 6, 8, 10, 12, 14}''.</div>}}

Revision as of 08:00, 23 August 2015


Intersection[ <List>, <List> ]
Gives you a new list containing all elements that are part of both lists.
Example:
Let list = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} and list1 = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30} be two lists. Intersection[ list, list1 ] yields a new list list2 = {2, 4, 6, 8, 10, 12, 14}.
© 2024 International GeoGebra Institute