{"id":4362,"date":"2017-09-22T03:55:34","date_gmt":"2017-09-22T03:55:34","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=4362"},"modified":"2024-09-04T07:05:50","modified_gmt":"2024-09-04T07:05:50","slug":"matrix-multiplication-using-octave","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/matrix-multiplication-using-octave\/","title":{"rendered":"Matrix multiplication using Octave"},"content":{"rendered":"<h2>Matrix multiplication using Octave<\/h2>\n<p>Let&#8217;s learn different matrix multiplication using the Octave or Matlab tool. In general, we will discuss two multiplications in this tutorial:<\/p>\n<ul>\n<li><strong>Element-to-element<\/strong><\/li>\n<li><strong>Matrix-to-matrix<\/strong><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<pre>&gt;&gt; A = [1 2 3 ; 4 5 6 ; 7 8 9 ];\r\n\r\n&gt;&gt; disp(A) 1 2 3 4 5 6 7 8 9\r\n\r\n&gt;&gt; R = A.*A ; \r\n\r\n&gt;&gt; disp(R);\r\n\r\n1 4 9\r\n\r\n16 25 36\r\n\r\n49 64 81\r\n\r\n\r\n&gt;&gt; B = A*A ;\r\n\r\n&gt;&gt; disp(B);\r\n\r\n30 36 42\r\n\r\n66 81 96\r\n\r\n102 126 150\r\n\r\n&gt;&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4368\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/element-to-element.png\" alt=\"element-to-element\" width=\"1915\" height=\"1121\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/element-to-element.png 1915w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/element-to-element-300x176.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/element-to-element-1024x599.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/element-to-element-768x450.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/element-to-element-1536x899.png 1536w\" sizes=\"auto, (max-width: 1915px) 100vw, 1915px\" \/><\/p>\n<h3>Element-to-element<\/h3>\n<p>We can use the times <strong>(.* )<\/strong> operator for the multiplication. For example:<\/p>\n<p><strong>R = A.*A;<\/strong><\/p>\n<p><strong>disp(R) ;<\/strong><\/p>\n<p>Alternatively,<\/p>\n<p><strong>R=times(A,A);<\/strong><\/p>\n<h3>Matrix-to-Matrix<\/h3>\n<p>We can perform using the * operator.<\/p>\n<p><strong>C= A*A;<\/strong><\/p>\n<pre><\/pre>\n<pre>&gt;&gt; A = [1 2 3 ; 4 5 6 ; 7 8 9 ];\r\n\r\n&gt;&gt; C= A*A; \r\n\r\n&gt;&gt; disp(A); \r\n\r\n1 2 3 \r\n        \r\n4 5 6 \r\n        \r\n7 8 9 \r\n        \r\n        \r\n&gt;&gt; disp(C); \r\n\r\n30 36 42 \r\n        \r\n66 81 96\r\n        \r\n102 126 150 \r\n        \r\n&gt;&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>Help and information about Octave is also available on the internet at <a href=\"https:\/\/www.octave.org\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.octave.org<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Matrix multiplication using Octave Let&#8217;s learn different matrix multiplication using the Octave or Matlab tool. In general, we will discuss two multiplications in this tutorial: Element-to-element Matrix-to-matrix &nbsp; &gt;&gt; A = [1 2 3 ; 4 5 6 ; 7 8 9 ]; &gt;&gt; disp(A) 1 2 3 4 5 6 7 8 9 &gt;&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-4362","post","type-post","status-publish","format-standard","hentry","category-octave","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=4362"}],"version-history":[{"count":6,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4362\/revisions"}],"predecessor-version":[{"id":24029,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4362\/revisions\/24029"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=4362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=4362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=4362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}