http://wiki.math.bme.hu/history/Informatika1-2015/OsszefoglaloZH3?feed=atom&
Informatika1-2015/OsszefoglaloZH3 - Laptörténet
2024-03-28T08:59:33Z
Az oldal laptörténete a wikiben
MediaWiki 1.18.1
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11327&oldid=prev
Kkovacs: /* Wolfram Mathematica */
2015-12-09T17:57:57Z
<p><span class="autocomment">Wolfram Mathematica</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 9., 17:57-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">205. sor:</td>
<td colspan="2" class="diff-lineno">205. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[1]:= Table[f'[x],{f,{Sin, Cos, Log}}]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[1]:= Table[f'[x],{f,{Sin, Cos, Log}}]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[1]= {Cos[x], -Sin[x], 1/x}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[1]= {Cos[x], -Sin[x], 1/x}</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Több dimenziós Table, például <del class="diffchange diffchange-inline">modulo három </del>szorzótábla:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Több dimenziós Table, például szorzótábla <ins class="diffchange diffchange-inline">1-tõl 10-ig</ins>:</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  Table<del class="diffchange diffchange-inline">[Mod</del>[i j<del class="diffchange diffchange-inline">, 3]</del>, {i, <del class="diffchange diffchange-inline">0</del>, <del class="diffchange diffchange-inline">2</del>}, {j, <del class="diffchange diffchange-inline">0</del>, <del class="diffchange diffchange-inline">2</del>}] <del class="diffchange diffchange-inline">// MatrixForm</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  Table[i <ins class="diffchange diffchange-inline">* </ins>j, {i, <ins class="diffchange diffchange-inline">1</ins>, <ins class="diffchange diffchange-inline">10</ins>}, {j, <ins class="diffchange diffchange-inline">1</ins>, <ins class="diffchange diffchange-inline">10</ins>}]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Függvények hattatása ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Függvények hattatása ===</div></td></tr>
<tr><td colspan="2" class="diff-lineno">230. sor:</td>
<td colspan="2" class="diff-lineno">230. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Total[{x,y}]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Total[{x,y}]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Listára elemenként hattathatunk függvényt a <tt>Map</tt> függvénnyel vagy a <tt>/@</tt> szimbólummal.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Listára elemenként hattathatunk függvényt a <tt>Map</tt> függvénnyel vagy a <tt>/@</tt> szimbólummal.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  f/@{x,y,z} === {f[x],f[y],<del class="diffchange diffchange-inline">g</del>[z]}</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  f/@{x,y,z} === {f[x],f[y],<ins class="diffchange diffchange-inline">f</ins>[z]}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Példák</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Példák</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Table[Cos[x], {x,0,Pi,Pi/6}]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Table[Cos[x], {x,0,Pi,Pi/6}]</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11298&oldid=prev
Kkovacs: /* Sage */
2015-12-08T02:08:46Z
<p><span class="autocomment">Sage</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 8., 02:08-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">142. sor:</td>
<td colspan="2" class="diff-lineno">142. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  show(p1 + p2)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  show(p1 + p2)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Figyeljük meg, hogy össze kellett adni a két függvény rajzot, így tudtuk egybe kirajzolni.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Figyeljük meg, hogy össze kellett adni a két függvény rajzot, így tudtuk egybe kirajzolni.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Listák ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Listákat máshogy kell készítenünk, mint Octave-ban:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><python></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">simaLista = [2, 3, 6]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">tobbSzintu = [[2, 3], [4, 7]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">felsorolas = range(1, 10) # [1, 2, 3, 4, 5, 6, 7, 8, 9]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></python></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Listaértelmezés ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Listaértelmezés ===</div></td></tr>
<tr><td colspan="2" class="diff-lineno">163. sor:</td>
<td colspan="2" class="diff-lineno">172. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Például az összes prím pár, melyeknek az egészosztottjuk is prím:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Például az összes prím pár, melyeknek az egészosztottjuk is prím:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[(n, m) for n in range(1, 100) for m in range(1, 100) if is_prime(n) and is_prime(m) and is_prime(n // m)]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[(n, m) for n in range(1, 100) for m in range(1, 100) if is_prime(n) and is_prime(m) and is_prime(n // m)]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Wolfram Mathematica ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Wolfram Mathematica ==</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11297&oldid=prev
Kkovacs, 2015. december 8., 02:05-n
2015-12-08T02:05:15Z
<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 8., 02:05-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">85. sor:</td>
<td colspan="2" class="diff-lineno">85. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f(3)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f(3)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>ennek az eredménye pl 0.1 lesz.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>ennek az eredménye pl 0.1 lesz.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Sage ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Sage ==</div></td></tr>
<tr><td colspan="2" class="diff-lineno">160. sor:</td>
<td colspan="2" class="diff-lineno">163. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Például az összes prím pár, melyeknek az egészosztottjuk is prím:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Például az összes prím pár, melyeknek az egészosztottjuk is prím:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[(n, m) for n in range(1, 100) for m in range(1, 100) if is_prime(n) and is_prime(m) and is_prime(n // m)]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[(n, m) for n in range(1, 100) for m in range(1, 100) if is_prime(n) and is_prime(m) and is_prime(n // m)]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Wolfram Mathematica ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Wolfram Mathematica ==</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11296&oldid=prev
Kkovacs: /* Sage */
2015-12-08T02:04:45Z
<p><span class="autocomment">Sage</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 8., 02:04-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">87. sor:</td>
<td colspan="2" class="diff-lineno">87. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Sage ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Sage ==</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Alapvető műveletek ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> 2 + 5</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> 4 * 2</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> 6 - 1</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> 4 / 3</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> 4 ^ 2</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Ne felejtsük el, hogy a 4/3 eredménye nem 1.3333 lesz, hanem 4/3, a Sage meghagyja szimbolikusan az eredményt az Octave-al ellentétben.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Változók ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Változók hasonlóan működnek, mint Octave-ban:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> a = 4</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> b = a * 4</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> a = 3</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Ezt lefuttatva a értéke 3 lesz, míg b értéke 16.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Egyenlet megoldás ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Egyenletet oldhatunk meg a ''solve(fv, változó)'' függvénnyel:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> x = var('x')</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> solve(x^2 + 2*x - 1 == 0, x)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Figyeljük meg, hogy dupla egyenlőségjel van az egyenletben. A sima 1 egyenlőségjel az értékadást jelöli, míg a 2 egyenlőségjel az összehasonlítást. Valamint ne felejtsük el, hogy a szimbolikus változók csak akkor szimbolikusak Sage-ben, ha annak definiáljuk őket.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Függvényt is menthetünk változóba:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> fv = 2 * x + 3</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> solve(fv == 4, x)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Megoldhatunk egyenletet numerikusan is (ha szimbolikusan nem megoldható):</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> find_root(abs(sin(x))^cos(x) == log(x), -10, 10)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Ekkor az utolsó két paraméter egy intervallumot határoz meg, amin belül keresi a megoldást.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Deriválás, integrálás ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">A ''diff'' paranccsal deriválhatunk egy függvényt:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> diff(x^2 * sin(x), x)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Míg az ''integrate''-el integrálhatunk:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> integrate(x^2 * sin(x), x)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Függvény rajzolás ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Függvényeket kirajzolhatunk a ''plot'' paranccsal:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> plot(x^2 * sin(x), 0, 10)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Itt az utolsó két paraméter az intervallum ahol kirajzolja a grafikont (''x'' koordináta).</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Kirajzolhatunk több függvényt is, ha változóba mentjük őket, majd a ''show''-val közösen mutatjuk őket:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> p1 = plot(x^2 * sin(x), 0, 10)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> p2 = plot(x^2 * cos(x), 0, 10)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> show(p1 + p2)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Figyeljük meg, hogy össze kellett adni a két függvény rajzot, így tudtuk egybe kirajzolni.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Listaértelmezés ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Ezt a részét vizsgáltuk a legrészletesebben a Sage-nek:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><python></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[kifejezés for elem in bejárható_objektum]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></python></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Egy olyan listát hoz létre melyben a ''kifejezés'' szerepel a ''bejárható_objektum'' minden elemére. Bejárható objektum például egy lista, az is amit a ''range'' függvény hoz létre.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><python></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[kifejezés for elem in bejárható_objektum if feltétel]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></python></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Mint az előző, de csak azok az elemek lesznek benne melyekre teljesül a ''feltétel''.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><python></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[kifejezés for elem1 in bejárható_objektum1 if feltétel1</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">          for elem2 in bejárható_objektum2 if feltétel2</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">          for elemN in bejárható_objektumN if feltételN]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></python></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Több feltétel és ciklus is írható akár.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Például az összes prím pár, melyeknek az egészosztottjuk is prím:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[(n, m) for n in range(1, 100) for m in range(1, 100) if is_prime(n) and is_prime(m) and is_prime(n // m)]</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Wolfram Mathematica ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Wolfram Mathematica ==</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11295&oldid=prev
Gaebor: /* Függvények hattatása */
2015-12-07T20:01:41Z
<p><span class="autocomment">Függvények hattatása</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 7., 20:01-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">126. sor:</td>
<td colspan="2" class="diff-lineno">126. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* A függvényhívás jele a '''szögletes zárójel'''! <tt>Sin[x]</tt></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* A függvényhívás jele a '''szögletes zárójel'''! <tt>Sin[x]</tt></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Postfix jelöléssel: <tt>x//Sin</tt>. Azt mondhatjuk: ''x-re hattatom a szinuszt''</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Postfix jelöléssel: <tt>x//Sin</tt>. Azt mondhatjuk: ''x-re hattatom a szinuszt''</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* Prefix jelöléssel: <tt>Sin@x</tt>. Más szóval: ''<del class="diffchange diffchange-inline">szinuszt hattatom </del>x-<del class="diffchange diffchange-inline">re</del>''</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* Prefix jelöléssel: <tt>Sin@x</tt>. Más szóval: ''<ins class="diffchange diffchange-inline">a szinusz hat </ins>x-<ins class="diffchange diffchange-inline">en</ins>''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* A dupla hattatás argumentumául veszi a lista elemeit:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* A dupla hattatás argumentumául veszi a lista elemeit:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f @@ {x,y,z} === f[x,y,z]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f @@ {x,y,z} === f[x,y,z]</div></td></tr>
</table>
Gaebor
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11294&oldid=prev
Gaebor: /* Függvények megadása */
2015-12-07T19:54:05Z
<p><span class="autocomment">Függvények megadása</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 7., 19:54-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">158. sor:</td>
<td colspan="2" class="diff-lineno">158. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f = Sin</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f = Sin</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f = Function[x,Sin[x]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f = Function[x,Sin[x]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Ezek bármelyikével<del class="diffchange diffchange-inline">:</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Ezek bármelyikével <ins class="diffchange diffchange-inline">a következő eredményt kapom</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[1]:= f'[x]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[1]:= f'[x]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[1]= Cos[x]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[1]= Cos[x]</div></td></tr>
</table>
Gaebor
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11293&oldid=prev
Gaebor: /* Wolfram Mathematica */
2015-12-07T19:53:15Z
<p><span class="autocomment">Wolfram Mathematica</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 7., 19:53-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">151. sor:</td>
<td colspan="2" class="diff-lineno">151. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos /@ Range[0,Pi,Pi/6]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos /@ Range[0,Pi,Pi/6]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos[Range[0,Pi,Pi/6]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos[Range[0,Pi,Pi/6]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Függvények megadása ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Az alábbiakban ugyanazt a függvényt definiálom:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> f[x_] := Sin[x]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> f = Sin[#]&</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> f = Sin</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> f = Function[x,Sin[x]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Ezek bármelyikével:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> In[1]:= f'[x]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Out[1]= Cos[x]</ins></div></td></tr>
</table>
Gaebor
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11292&oldid=prev
Gaebor: /* Függvények hattatása */
2015-12-07T19:50:46Z
<p><span class="autocomment">Függvények hattatása</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 7., 19:50-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">124. sor:</td>
<td colspan="2" class="diff-lineno">124. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Függvények hattatása ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Függvények hattatása ===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"> </del>* A függvényhívás jele a '''szögletes zárójel'''! <tt>Sin[x]</tt></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* A függvényhívás jele a '''szögletes zárójel'''! <tt>Sin[x]</tt></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"> </del>* Postfix jelöléssel: <tt>x//Sin</tt> ''x-re hattatom a szinuszt''</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* Postfix jelöléssel: <tt>x//Sin</tt><ins class="diffchange diffchange-inline">. Azt mondhatjuk: </ins>''x-re hattatom a szinuszt''</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"> </del>* Prefix jelöléssel: <tt>Sin@x</tt> ''szinuszt hattatom x-re''</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* Prefix jelöléssel: <tt>Sin@x</tt><ins class="diffchange diffchange-inline">. Más szóval: </ins>''szinuszt hattatom x-re''</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"> </del>* A dupla hattatás argumentumául veszi a lista elemeit:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* A dupla hattatás argumentumául veszi a lista elemeit:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f @@ {x,y,z} === f[x,y,z]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  f @@ {x,y,z} === f[x,y,z]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Más mint az alábbi:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Más mint az alábbi:</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  f @ {x,y,z} <del class="diffchange diffchange-inline">=== </del>f[{x,y,z}]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  f @ {x,y,z}</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">ami</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins>f[{x,y,z}]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Például vegyük a <tt>Sin</tt> függvényt, ekkor az alábbiak megegyeznek:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Például vegyük a <tt>Sin</tt> függvényt, ekkor az alábbiak megegyeznek:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Sin[Pi]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Sin[Pi]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  Pi//Sin</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  Pi // Sin</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  Sin@Pi</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  Sin @ Pi</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  Sin@@{Pi}</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  Sin @@ {Pi}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Az összeadásra:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Az összeadásra:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x+y</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x+y</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Plus[x,y]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Plus[x,y]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  Plus@@{x,y}</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  Plus @@ {x,y}</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  {x,y}//Total</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  {x,y} // Total</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Total[{x,y}]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Total[{x,y}]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Listára elemenként hattathatunk függvényt<del class="diffchange diffchange-inline">:</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Listára elemenként hattathatunk függvényt <ins class="diffchange diffchange-inline">a <tt>Map</tt> függvénnyel vagy a <tt>/@</tt> szimbólummal.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> f/@{x,y,z} === {f[x],f[y],g[z]}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Példák</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Table[Cos[x], {x,0,Pi,Pi/6}]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Table[Cos[x], {x,0,Pi,Pi/6}]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos /@ Table[x,  {x,0,Pi,Pi/6}]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos /@ Table[x,  {x,0,Pi,Pi/6}]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos /@ Range[0,Pi,Pi/6]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos /@ Range[0,Pi,Pi/6]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos[Range[0,Pi,Pi/6]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Cos[Range[0,Pi,Pi/6]]</div></td></tr>
</table>
Gaebor
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11291&oldid=prev
Gaebor: /* Függvények hattatása */
2015-12-07T19:47:21Z
<p><span class="autocomment">Függvények hattatása</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 7., 19:47-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">124. sor:</td>
<td colspan="2" class="diff-lineno">124. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Függvények hattatása ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Függvények hattatása ===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Vegyük </del>a <tt>Sin</tt> függvényt, ekkor <del class="diffchange diffchange-inline">ezek ugyan azok</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> * A függvényhívás jele a '''szögletes zárójel'''! <tt>Sin[x]</tt></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> * Postfix jelöléssel: <tt>x//Sin</tt> ''x-re hattatom a szinuszt''</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> * Prefix jelöléssel: <tt>Sin@x</tt> ''szinuszt hattatom x-re''</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> * A dupla hattatás argumentumául veszi a lista elemeit:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> f @@ {x,y,z} === f[x,y,z]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Más mint az alábbi:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> f @ {x,y,z} === f[{x,y,z}]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Például vegyük </ins>a <tt>Sin</tt> függvényt, ekkor <ins class="diffchange diffchange-inline">az alábbiak megegyeznek</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Sin[Pi]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Sin[Pi]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Pi//Sin</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Pi//Sin</div></td></tr>
</table>
Gaebor
http://wiki.math.bme.hu/index.php?title=Informatika1-2015/OsszefoglaloZH3&diff=11290&oldid=prev
Gaebor: /* Wolfram Mathematica */
2015-12-07T19:41:09Z
<p><span class="autocomment">Wolfram Mathematica</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2015. december 7., 19:41-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">102. sor:</td>
<td colspan="2" class="diff-lineno">102. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[1]:= Range[5]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[1]:= Range[5]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[1]= {1,2,3,4,5}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[1]= {1,2,3,4,5}</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[2]:= Range[2,6]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[2]:= Range[2,6]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[2]= {2,3,4,5,6}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[2]= {2,3,4,5,6}</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[3]:= Range[2, 5, 0.5]  </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  In[3]:= Range[2, 5, 0.5]  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[3]= {2., 2.5, 3., 3.5, 4., 4.5, 5.}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Out[3]= {2., 2.5, 3., 3.5, 4., 4.5, 5.}</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">* Table</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Range-hez hasonlóan</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> In[1]:= Table[i,{i,1,5}]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Out[1]= {1,2,3,4,5}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">A Table hasába bármilyen kifejezést írhatunk</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> In[1]:= Table[x^i,{i,1,5}]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Out[1]= {x,x^2,x^3,x^4,x^5}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Az elemek explicit felsorolásával</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> In[1]:= Table[f'[x],{f,{Sin, Cos, Log}}]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Out[1]= {Cos[x], -Sin[x], 1/x}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Több dimenziós Table, például modulo három szorzótábla:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Table[Mod[i j, 3], {i, 0, 2}, {j, 0, 2}] // MatrixForm</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">=== Függvények hattatása ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Vegyük a <tt>Sin</tt> függvényt, ekkor ezek ugyan azok:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Sin[Pi]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Pi//Sin</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Sin@Pi</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Sin@@{Pi}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Az összeadásra:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> x+y</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Plus[x,y]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Plus@@{x,y}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> {x,y}//Total</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Total[{x,y}]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Listára elemenként hattathatunk függvényt:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Table[Cos[x], {x,0,Pi,Pi/6}]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Cos /@ Table[x,  {x,0,Pi,Pi/6}]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Cos /@ Range[0,Pi,Pi/6]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> Cos[Range[0,Pi,Pi/6]]</ins></div></td></tr>
</table>
Gaebor