Jump to content

Matrix/Practice/Matrix multiplication: Difference between revisions

From Wikibase
AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)
AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)
Line 32: Line 32:
{{Hidden solution}}
{{Hidden solution}}


`np.dot` gives the matrix product, not the element-wise one. The product exists only when the number of columns of $M_1$ equals the number of rows of $M_2$, which the code tests before multiplying.
<code>np.dot</code> gives the matrix product, not the element-wise one. The product exists only when the number of columns of $M_1$ equals the number of rows of $M_2$, which the code tests before multiplying.


<syntaxhighlight lang="python" class="pyodide" copy>
<syntaxhighlight lang="python" class="pyodide" copy>

Revision as of 09:32, 19 November 2026

Languages: English · français · Esperanto

The solutions are programmatic: the code in each