http://wiki.math.bme.hu/history/Informatics1-2017/Practice9?feed=atom&
Informatics1-2017/Practice9 - Laptörténet
2024-03-29T04:37:34Z
Az oldal laptörténete a wikiben
MediaWiki 1.18.1
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13156&oldid=prev
Kkovacs: /* typeinfo */
2017-11-06T13:50:21Z
<p><span class="autocomment">typeinfo</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 2017. november 6., 13:50-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">133. sor:</td>
<td colspan="2" class="diff-lineno">133. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  typeinfo ([1:4])</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  typeinfo ([1:4])</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  typeinfo (1 >= 0)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  typeinfo (1 >= 0)</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  typeinfo ("<del class="diffchange diffchange-inline">szöveg</del>")</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  typeinfo ("<ins class="diffchange diffchange-inline">sometext</ins>")</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  typeinfo ([1 + 2i 1 - 1i])</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  typeinfo ([1 + 2i 1 - 1i])</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>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13155&oldid=prev
Kkovacs: /* SOE */
2017-11-06T13:10:28Z
<p><span class="autocomment">SOE</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 2017. november 6., 13:10-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">361. sor:</td>
<td colspan="2" class="diff-lineno">361. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   x + 2y = 3</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   x + 2y = 3</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  4x + 5y = 6</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  4x + 5y = 6</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>1<del class="diffchange diffchange-inline">. megoldás</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Solution </ins>1:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A = [1 2; 4 5]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A = [1 2; 4 5]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  b = [3; 6]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  b = [3; 6]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = A^-1 * b</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = A^-1 * b</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>2<del class="diffchange diffchange-inline">. megoldás</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Solution </ins>2:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = A \ b</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = A \ b</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>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13154&oldid=prev
Kkovacs: /* More LER */
2017-11-06T13:09:10Z
<p><span class="autocomment">More LER</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 2017. november 6., 13:09-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">368. sor:</td>
<td colspan="2" class="diff-lineno">368. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = A \ b</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = A \ b</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: #ffa; color:black; font-size: smaller;"><div>=== More <del class="diffchange diffchange-inline">LER </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== More <ins class="diffchange diffchange-inline">SOE </ins>===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Solve the following systems of equations:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Solve the following systems of equations:</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>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13153&oldid=prev
Kkovacs: /* Functions */
2017-11-06T13:08:08Z
<p><span class="autocomment">Functions</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 2017. november 6., 13:08-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">332. sor:</td>
<td colspan="2" class="diff-lineno">332. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  ans = 0.10000</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  ans = 0.10000</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: #ffa; color:black; font-size: smaller;"><div>Defining <del class="diffchange diffchange-inline">the </del>functions:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Defining functions:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  function <<result>> = <<function name>> (<<variables>>)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  function <<result>> = <<function name>> (<<variables>>)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   ...</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   ...</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13152&oldid=prev
Kkovacs: /* Functions */
2017-11-06T13:07:49Z
<p><span class="autocomment">Functions</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 2017. november 6., 13:07-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">332. sor:</td>
<td colspan="2" class="diff-lineno">332. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  ans = 0.10000</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  ans = 0.10000</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: #ffa; color:black; font-size: smaller;"><div>Defining functions:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Defining <ins class="diffchange diffchange-inline">the </ins>functions:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  function <<result>> = <<function name>> (<<variables>>)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  function <<result>> = <<function name>> (<<variables>>)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   ...</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   ...</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13149&oldid=prev
Kkovacs: /* Tasks */
2017-11-06T05:24:53Z
<p><span class="autocomment">Tasks</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 2017. november 6., 05:24-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">349. sor:</td>
<td colspan="2" class="diff-lineno">349. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Tasks ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Tasks ==</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Mi ez</del>? ===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">What is this</ins>? ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>What does the following do?</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>What does the following do?</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A=[1 2 3; 4 5 6; 7 8 9];</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A=[1 2 3; 4 5 6; 7 8 9];</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13148&oldid=prev
Kkovacs, 2017. november 6., 05:24-n
2017-11-06T05:24:29Z
<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 2017. november 6., 05:24-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">348. sor:</td>
<td colspan="2" class="diff-lineno">348. 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>== Tasks ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Tasks ==</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;">=== Elemi sorműveletek elvégzése ===</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;">Hozzunk létre egy egyjegyű nemnegatív egészekből álló 4x5-ös mátrixot, majd cseréljük ki két sorát, szorozzuk be a második sorát 2-vel és adjuk az első sorának kétszeresét a harmadik sorhoz! (A mátrix redukált lépcsős alakjának meghatározására azért a <tt>rref</tt> függvényt használjuk!)</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>=== Mi ez? ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Mi ez? ===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Figyeljük meg a következőket.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">What does the following do?</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A=[1 2 3; 4 5 6; 7 8 9];</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A=[1 2 3; 4 5 6; 7 8 9];</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  B=[9 8 7; 6 5 4; 3 2 1];</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  B=[9 8 7; 6 5 4; 3 2 1];</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  trace (A*B')</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  trace (A*B')</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A(:)' * B(:)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A(:)' * B(:)</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Mi a </del><tt>trace(A*B')</tt>?</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">What is </ins><tt>trace(A*B')</tt>?</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">LER </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">SOE </ins>===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Számoljuk ki a következő lineáris egyenletrendszer megoldását</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Calculate the solution of the following system of equations</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   x + 2y = 3</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   x + 2y = 3</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  4x + 5y = 6</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  4x + 5y = 6</div></td></tr>
<tr><td colspan="2" class="diff-lineno">371. sor:</td>
<td colspan="2" class="diff-lineno">368. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = A \ b</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = A \ b</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Még </del>LER ===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">More </ins>LER ===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Oldjuk meg a következő egyenletrendszereket</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Solve the following systems of equations</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>   x + 5y = 1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   x + 5y = 1</div></td></tr>
<tr><td colspan="2" class="diff-lineno">384. sor:</td>
<td colspan="2" class="diff-lineno">381. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  5x + 4y + 6z = 2</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  5x + 4y + 6z = 2</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Nagy mátrix okosan </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">Large matrix </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: #ffa; color:black; font-size: smaller;"><div>* <del class="diffchange diffchange-inline">Készítsük el a következő mátrixot okosan! (Minél kevesebb karaktert használva.)</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* <ins class="diffchange diffchange-inline">Create the following matrix using the least characters you can:</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  1 2 2 2 2 2 2 2 2 2</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  1 2 2 2 2 2 2 2 2 2</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  2 2 2 2 2 2 2 2 2 2</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  2 2 2 2 2 2 2 2 2 2</div></td></tr>
<tr><td colspan="2" class="diff-lineno">398. sor:</td>
<td colspan="2" class="diff-lineno">395. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  2 2 2 2 2 2 2 2 2 10</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  2 2 2 2 2 2 2 2 2 10</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: #ffa; color:black; font-size: smaller;"><div>* <del class="diffchange diffchange-inline">És most ezt</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* <ins class="diffchange diffchange-inline">Same as before</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   0  1  0  0  0  0  0  0  0</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   0  1  0  0  0  0  0  0  0</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  -1  0  1  0  0  0  0  0  0</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  -1  0  1  0  0  0  0  0  0</div></td></tr>
<tr><td colspan="2" class="diff-lineno">409. sor:</td>
<td colspan="2" class="diff-lineno">406. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   0  0  0  0  0  0  0 -1  0</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   0  0  0  0  0  0  0 -1  0</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: #ffa; color:black; font-size: smaller;"><div>* <del class="diffchange diffchange-inline">Sakktáblaszabály</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* <ins class="diffchange diffchange-inline">Chessboard</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1  -1  1  -1  1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1  -1  1  -1  1</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   -1  1  -1  1  -1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   -1  1  -1  1  -1</div></td></tr>
<tr><td colspan="2" class="diff-lineno">416. sor:</td>
<td colspan="2" class="diff-lineno">413. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1  -1  1  -1  1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1  -1  1  -1  1</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Függvény mátrixokon </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">Function on matrices </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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Írjunk függvényt, mely az adott mátrix minden elemére alkalmazza </del>a <tt>2sin<sup>2</sup>x + 1</tt> <del class="diffchange diffchange-inline">függvényt</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Write </ins>a <ins class="diffchange diffchange-inline">function that applies the function </ins><tt>2sin<sup>2</sup>x + 1</tt> <ins class="diffchange diffchange-inline">to every element of a given matrix</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Részmátrix </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">Part of a matrix </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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Írjunk függvényt, mely egy </del>5x5<del class="diffchange diffchange-inline">-ös mátrix 2. és 4. sorából és 1.</del>, <del class="diffchange diffchange-inline">3. és 5. oszlopából álló mátrixot adja</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Write a function that separates a </ins>5x5 <ins class="diffchange diffchange-inline">matrix into a 2x5 matrix with the 2nd and 4th row, and a 3x5 with the 1st, 3rd</ins>, <ins class="diffchange diffchange-inline">5th</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Részmátrixon függvény </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">Part of a matrix function </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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Írjuk meg az elõzõ két függvény kombinációját, mely az adott mátrix 2. és 4. sorából és 1., 3. és 5. oszlopából álló mátrixon alkalmazza a </del><tt>2sin<sup>2</sup>x + 1</tt> <del class="diffchange diffchange-inline">függvényt</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Combine the previous two so that the function applies the </ins><tt>2sin<sup>2</sup>x + 1</tt> <ins class="diffchange diffchange-inline">function to both new matrices</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Minden második oszlop </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">Every second column </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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Írjunk függvényt, mely tetszőleges mátrix minden második oszlopából álló mátrixot adja vissza</del>. (<del class="diffchange diffchange-inline">Segítség</del>, <del class="diffchange diffchange-inline">a </del><tt>size</tt> <del class="diffchange diffchange-inline">sorvektorban megadja a mátrix dimenzióját</del>.)</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Write a function that outputs the matrix with every second column skipped in the input matrix</ins>. (<ins class="diffchange diffchange-inline">Help</ins>, <tt>size</tt> <ins class="diffchange diffchange-inline">can help with the dimension of the matrix</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Függvény alkalmazás csak adott elemeken </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">Applying a function to elements </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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Írjunk függvényt, mely a kapott mátrix csak minden második oszlopán hajtja végre </del>a <tt>2sin<sup>2</sup>x + 1</tt> <del class="diffchange diffchange-inline">függvényt. (Az eredmény mátrix dimenziója ugyanaz, mint </del>a <del class="diffchange diffchange-inline">kapott mátrix</del>.<del class="diffchange diffchange-inline">)</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Write </ins>a <ins class="diffchange diffchange-inline">function that applies the function </ins><tt>2sin<sup>2</sup>x + 1</tt> <ins class="diffchange diffchange-inline">to every second column of </ins>a <ins class="diffchange diffchange-inline">matrix</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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Segíts magadon </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">Help yourself </ins>===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Az </del>[https://www.gnu.org/software/octave/doc/v4.0.3/ octave <del class="diffchange diffchange-inline">dokumentációjában</del>], <del class="diffchange diffchange-inline">a </del>[http://stackoverflow.com/search?q=octave stackoverflow<del class="diffchange diffchange-inline">-n</del>] <del class="diffchange diffchange-inline">vagy a </del>Google<del class="diffchange diffchange-inline">-n.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">The </ins>[https://www.gnu.org/software/octave/doc/v4.0.3/ octave <ins class="diffchange diffchange-inline">documentation</ins>], [http://stackoverflow.com/search?q=octave stackoverflow] <ins class="diffchange diffchange-inline">or </ins>Google.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Az elemi szintű dolgok általában a Matlab [http://www.mathworks.com/help/matlab/ help] segítségével is megkereshetők</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></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: #ffa; color:black; font-size: smaller;"><div>=== <del class="diffchange diffchange-inline">Numerikus deriválás </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== <ins class="diffchange diffchange-inline">Numerical differentiation </ins>===</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Deriváljuk az </del><tt>f(x)=2x^2-3x+1</tt> <del class="diffchange diffchange-inline">függvényt numerikusan</del>! <del class="diffchange diffchange-inline">Adott egy </del><tt>x</tt> <del class="diffchange diffchange-inline">sorvektor, ami az abszcissza értékeket tartalmazza</del>, <tt>fx</tt> <del class="diffchange diffchange-inline">pedig a hozzájuk tartozó függvényértékeket</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Differentiate the function </ins><tt>f(x)=2x^2-3x+1</tt> <ins class="diffchange diffchange-inline">numerically</ins>! <ins class="diffchange diffchange-inline">Given a row vector </ins><tt>x</tt>, <ins class="diffchange diffchange-inline">and </ins><tt>fx</tt> <ins class="diffchange diffchange-inline">with the corresponding function values</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = 0:0.1:1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x = 0:0.1:1</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  fx = 2.*x.^2 - 3.*x + 1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  fx = 2.*x.^2 - 3.*x + 1</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Ekkor a függvény </del>[https://en.wikipedia.org/wiki/Numerical_differentiation <del class="diffchange diffchange-inline">numerikus deriváltja</del>]:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">The </ins>[https://en.wikipedia.org/wiki/Numerical_differentiation <ins class="diffchange diffchange-inline">numerical differentiation</ins>]:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  df = (fx(2:end) - fx(1:end-1)) ./ 0.1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  df = (fx(2:end) - fx(1:end-1)) ./ 0.1</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Nem egyenletes lépésközzel pedig</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">With non-linear steps</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  df = (fx(2:end) - fx(1:end-1)) ./ (x(2:end) - x(1:end-1))</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  df = (fx(2:end) - fx(1:end-1)) ./ (x(2:end) - x(1:end-1))</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13147&oldid=prev
Kkovacs, 2017. november 6., 05:06-n
2017-11-06T05:06:49Z
<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 2017. november 6., 05:06-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">298. sor:</td>
<td colspan="2" class="diff-lineno">298. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A (:)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A (:)</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: #ffa; color:black; font-size: smaller;"><div>== <del class="diffchange diffchange-inline">Vektorizáció </del>==</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>== <ins class="diffchange diffchange-inline">Vectorization </ins>==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Az </del>Octave<del class="diffchange diffchange-inline">-ban (MatLab-ban) általában egyszerre sok dolgot számolunk, nem csak egy értéken értékelünk ki egy függvényt</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">In </ins>Octave <ins class="diffchange diffchange-inline">we usually work with multiple numbers not just one</ins>.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Például az </del><tt>X</tt> <del class="diffchange diffchange-inline">mátrix minden sorának számoljuk ki a normáját (<tt>X</tt> lehet <tt>nx3</tt>-as, ahol <tt>n</tt> nagyon sok)</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">For example let us calculate the norm of every row in the matrix </ins><tt>X</tt>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  X = rand (10, 3);</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  X = rand (10, 3);</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  sqrt (sum (X.^2, 2))</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  sqrt (sum (X.^2, 2))</div></td></tr>
<tr><td colspan="2" class="diff-lineno">314. sor:</td>
<td colspan="2" class="diff-lineno">314. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1.01153</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1.01153</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1.07420</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1.07420</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Belülről kifelé haladva elemezzük a függvényeket</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Let us look at the functions</ins>:</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* <tt>X.^2</tt>: <del class="diffchange diffchange-inline">kiszámolja az elemenkénti négyzetet</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* <tt>X.^2</tt>: <ins class="diffchange diffchange-inline">calculates the square of the items</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* <tt>sum(&#9679;, 2)</tt>: <del class="diffchange diffchange-inline">összegzi </del>a <del class="diffchange diffchange-inline">mátrix sorait egy oszlopvektorba </del>(<del class="diffchange diffchange-inline">a </del>2 <del class="diffchange diffchange-inline">azt jelenti, a tömb második dimenziója, azaz a 2. index mentén</del>)</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* <tt>sum(&#9679;, 2)</tt>: <ins class="diffchange diffchange-inline">sums up the values into </ins>a <ins class="diffchange diffchange-inline">column vector </ins>(<ins class="diffchange diffchange-inline">the meaning of the </ins>2 <ins class="diffchange diffchange-inline">is to sum up along the second dimension</ins>)</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* <tt>sqrt</tt>: <del class="diffchange diffchange-inline">elemenként gyököt von</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* <tt>sqrt</tt>: <ins class="diffchange diffchange-inline">square root of every item</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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Számoljuk ki a </del><tt>2x^2-3x+1</tt> <del class="diffchange diffchange-inline">függvényértékeket, ahol </del><tt>x</tt> <del class="diffchange diffchange-inline">egy sorvektor</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Calculate the function value </ins><tt>2x^2-3x+1</tt> <ins class="diffchange diffchange-inline">where </ins><tt>x</tt> <ins class="diffchange diffchange-inline">is a row vector</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x=0:0.1:1;</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  x=0:0.1:1;</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  fx=2.*x.^2 - 3.*x + 1</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  fx=2.*x.^2 - 3.*x + 1</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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">A ''vektorizáció'' lényege, hogy ahol lehet mátrix és vektor műveletekre vezessük vissza a számításainkat, mert '''1000 darab számpár összeszorzása lassabb, mint két darab 1000 hosszú vektor szorzása'''!</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>== <ins class="diffchange diffchange-inline">Functions </ins>==</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">Try the following (multiple lines)</ins>!</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>== <del class="diffchange diffchange-inline">Függvények </del>==</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Írjuk be az <tt>octave</tt> a parancssorába a következőket, vigyázzunk több soros lesz</del>!</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  > function fx = f (x)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  > function fx = f (x)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  >  fx = 1 / (x^2 + 1);</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  >  fx = 1 / (x^2 + 1);</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  > endfunction</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  > endfunction</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Majd próbáljuk ki</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Test it</ins>:</div></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>  ans = 0.10000</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  ans = 0.10000</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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Függvények megadása</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Defining functions</ins>:</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  function <<<del class="diffchange diffchange-inline">az eredmény</del>>> = <<<del class="diffchange diffchange-inline">a függvény neve</del>>> (<<<del class="diffchange diffchange-inline">változók</del>>>)</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  function <<<ins class="diffchange diffchange-inline">result</ins>>> = <<<ins class="diffchange diffchange-inline">function name</ins>>> (<<<ins class="diffchange diffchange-inline">variables</ins>>>)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   ...</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   ...</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  endfunction</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  endfunction</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">A függvény hasában bármit számolhatunk</del>, <del class="diffchange diffchange-inline">de a végén adjunk értéket </del><tt><<<del class="diffchange diffchange-inline">az eredmény</del>>></tt> <del class="diffchange diffchange-inline">változónak</del>. <del class="diffchange diffchange-inline">A függvény hasában érdemes csendes számítást végezni, itt használjunk mindenütt pontosvesszőt </del>('''<tt>;</tt>''') <del class="diffchange diffchange-inline">a sor végén!</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Any command can be inside the function</ins>, <ins class="diffchange diffchange-inline">but at the end the </ins><tt><<<ins class="diffchange diffchange-inline">result</ins>>></tt> <ins class="diffchange diffchange-inline">variable has to contain the result of the function</ins>. <ins class="diffchange diffchange-inline">We usually use silent calculation </ins>('''<tt>;</tt>''') <ins class="diffchange diffchange-inline">inside the function.</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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Egy másik függvény</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Another function</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  function R = remove_last (x)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  function R = remove_last (x)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   R = x (1:end-1);</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   R = x (1:end-1);</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  endfunction</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  endfunction</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Példa</del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Example</ins>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  > remove_last (1:5)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  > remove_last (1:5)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  ans =</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  ans =</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1  2  3  4</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   1  2  3  4</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: #ffa; color:black; font-size: smaller;"><div>== <del class="diffchange diffchange-inline">Feladatok </del>==</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>== <ins class="diffchange diffchange-inline">Tasks </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>=== Elemi sorműveletek elvégzése ===</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>=== Elemi sorműveletek elvégzése ===</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13146&oldid=prev
Kkovacs: /* Indexes */
2017-11-06T04:35:08Z
<p><span class="autocomment">Indexes</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 2017. november 6., 04:35-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">281. sor:</td>
<td colspan="2" class="diff-lineno">281. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  l (1:2:11) = 0</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  l (1:2:11) = 0</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: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Partial </del>matrix:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Part of a </ins>matrix:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A = [1 2 3; 4 5 6; 7 8 9];</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A = [1 2 3; 4 5 6; 7 8 9];</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A (1:3, 1:2)</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  A (1:3, 1:2)</div></td></tr>
</table>
Kkovacs
http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13145&oldid=prev
Kkovacs, 2017. november 6., 04:34-n
2017-11-06T04:34:45Z
<p></p>
<a href="http://wiki.math.bme.hu/index.php?title=Informatics1-2017/Practice9&diff=13145&oldid=13144">Változtatások megtekintése</a>
Kkovacs