{"id":4606,"date":"2009-10-08T18:18:55","date_gmt":"2009-10-08T22:18:55","guid":{"rendered":"https:\/\/www.bu.edu\/tech\/research\/scv_import\/documentation\/software-help\/mathematics\/matlab\/"},"modified":"2025-07-30T15:48:07","modified_gmt":"2025-07-30T19:48:07","slug":"matlab","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/support\/research\/software-and-programming\/common-languages\/matlab\/","title":{"rendered":"MATLAB"},"content":{"rendered":"<h2>Description<\/h2>\n<p>MATLAB (MATrix LABoratory) is a popular, powerful, general-purpose system or environment for matrix algebra calculations and many other more specific computations and applications in Biology, Aerospace, Finance, data acquisition, etc. MATLAB may be used interactively or in batch. In addition, it supports a wide array of graphical applications, ranging from bar charts, line and surface plots to volumetric rendering.<\/p>\n<p>Boston University offers a MATLAB Campus-Wide License. That means unlimited use of MATLAB, Simulink, and online learning tools for all\u202fstudents,\u202ffaculty, staff,\u202fand researchers, on\u202fand off campus, on any device. Find out more and download what you need from our MATLAB portal:\u202f<a href=\"https:\/\/www.mathworks.com\/academia\/tah-portal\/boston-university-40523728.html\">Boston University MATLAB Portal<\/a><\/p>\n<p>Take advantage of free access to interactive courses through Boston University\u2019s Campus-Wide Online Training subscription and build your MATLAB\/Simulink skills. Find out more: <a href=\"http:\/\/matlab.mathworks.com\">Campus-Wide Online Training<\/a> and then view the courses under Online Training.<\/p>\n<p>Use <strong>MATLAB Grader<\/strong> to create interactive, auto-graded course assignments with instant learner feedback. Find out more: <a href=\"https:\/\/www.mathworks.com\/products\/matlab-grader.html?s_tid=srchtitle\">MATLAB Grader<\/a><\/p>\n<h2>Availability and Setup<\/h2>\n<p>Many older as well as recent versions of MATLAB are available, you can load any of them using the <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/software-and-programming\/software-and-applications\/modules\/\">modules<\/a> as explained <a href=\"http:\/\/sccsvc.bu.edu\/software\/#\/package\/matlab\/\">here<\/a>.<\/p>\n<p>Those who wish to install MATLAB on their own computers, rather than using it on the SCC, should consult the <a href=\"https:\/\/www.bu.edu\/tech\/services\/cccs\/desktop\/distribution\/mathsci\/matlab\/\">MATLAB licenses page<\/a>.<\/p>\n<p>To enable graphics, MATLAB is best used from an OnDemand Desktop <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/scc-ondemand\/\">environment<\/a>.<\/p>\n<p>Users accessing the SCC to run MATLAB from a PC or Mac in a terminal will likely want to set up <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/ssh-x-forwarding\/\">X Forwarding<\/a>.<\/p>\n<h2>Running MATLAB Interactively<\/h2>\n<p>Running MATLAB interactively in the default mode enables graphics. This is best done in an <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/scc-ondemand\/\">OnDemand<\/a> Desktop session to run it. To invoke MATLAB on the SCC, load the desired module version, then type:<\/p>\n<pre><code class=\"code-block\"><span class=\"prompt\">scc1$<\/span> <span class=\"command\">matlab<\/span><\/code><\/pre>\n<p>This should bring up MATLAB in its own separate window with the <b>Command Window<\/b> active and the <code><span class=\"prompt\">&gt;&gt;<\/span><\/code> MATLAB command prompt. This signifies that you have successfully started the MATLAB environment.<\/p>\n<p>On clients without xterm or if graphics are not needed, you can start MATLAB with graphics disabled:<\/p>\n<pre><code class=\"code-block\"><span class=\"prompt\">scc1$<\/span> <span class=\"command\">matlab -nodisplay<\/span>\r\n<span class=\"output\">\r\n                            &lt; M A T L A B (R) &gt;\r\n                  Copyright 1984-2013 The MathWorks, Inc.\r\n                    R2013a (8.1.0.604) 64-bit (glnxa64)\r\n                             February 15, 2013\r\n\r\n\r\nTo get started, type one of these: helpwin, helpdesk, or demo.\r\nFor product information, visit www.mathworks.com.<\/span>\r\n\r\n<span class=\"prompt\">&gt;&gt;<\/span><\/code><\/pre>\n<p>To close either version of the MATLAB session, enter <code><span class=\"command\">exit<\/span><\/code> or <code><span class=\"command\">quit<\/span><\/code>:<\/p>\n<pre><code class=\"code-block\"><span class=\"prompt\">&gt;&gt;<\/span> <span class=\"command\">exit<\/span><\/code><\/pre>\n<h2>Running MATLAB in Batch Jobs<a name=\"BATCH\"><\/a><\/h2>\n<p>See <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/software-and-programming\/rcs-software-packages\/matlab\/matlab-batch\/\">MATLAB Batch Jobs on the SCC<\/a>.<\/p>\n<h2>Matlab on AMD CPUs<a name=\"BATCH\"><\/a><\/h2>\n<p>The large majority of compute nodes on the SCC use Intel CPUs, with the remainder using AMD CPUs. For information on specific nodes, refer to the <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/computing-resources\/tech-summary\/\">Technical Summary<\/a> page. When running Matlab version 2022a or newer on AMD CPUs, the underlying libraries for linear algebra (BLAS and LAPACK) can be changed from the default implementation (the Intel MKL libraries) for ones optimized by AMD for their CPUs. This may improve performance of your Matlab code. The change is done by setting a pair of environment variables, either interactively in a terminal before starting Matlab or in a batch job:<\/p>\n<pre><code class=\"code-block\"><span class=\"command\">export BLAS_VERSION=libblis-mt.so<\/span>\r\n<span class=\"command\">export LAPACK_VERSION=libflame.so<\/span><\/code><\/pre>\n<h2>Help\/Documentation<\/h2>\n<p>To get started with MATLAB, you can watch our video <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/training-consulting\/rcs-tutorial-videos-and-third-party-tutorials\/using-matlab\/\">Using MATLAB on the SCC<\/a>. Alternatively, you can go to The Mathworks, MATLAB&#8217;s developer, site to learn using their <a href=\"https:\/\/matlabacademy.mathworks.com\/details\/matlab-onramp\/gettingstarted\">MATLAB Onramp<\/a> series on a wide range of applications. More frequently, users get help from within the MATLAB environment using the command <code><span class=\"command\">help<\/span><\/code> followed by the name of the utility function. For example,<\/p>\n<pre><code class=\"code-block\"><span class=\"prompt\">&gt;&gt;<\/span> <span class=\"command\">help<\/span> <span class=\"placeholder\">cos<\/span><\/code><\/pre>\n<p>If you don&#8217;t know the name of the utility, you can search with a succinct description (enclosed in single quotes to preserve spaces if multiple words are used) of the application, like this:<\/p>\n<pre><code class=\"code-block\"><span class=\"prompt\">&gt;&gt;<\/span> <span class=\"command\">lookfor<\/span> <span class=\"placeholder\">cosine\r\n<span class=\"output\">acos                           - Inverse cosine, result in radians.\r\nacosd                          - Inverse cosine, result in degrees.\r\nacosh                          - Inverse hyperbolic cosine.\r\ncos                            - Cosine of argument in radians.\r\ncosd                           - Cosine of argument in degrees.\r\ncosh                           - Hyperbolic cosine.\r\n. . .<\/span><\/span><\/code><\/pre>\n<p>To read the MATLAB documentation:<\/p>\n<pre><code class=\"code-block\"><span class=\"prompt\">&gt;&gt;<\/span> <span class=\"command\">help doc<\/span><\/code><\/pre>\n<p>As part of our <a href=\"http:\/\/scv.bu.edu\/examples\/\">RCS Online Code Examples<\/a> section, we also have quite a large number of <a href=\"http:\/\/scv.bu.edu\/examples\/matlab\/\">MATLAB code examples<\/a> covering a broad set of topics.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description MATLAB (MATrix LABoratory) is a popular, powerful, general-purpose system or environment for matrix algebra calculations and many other more specific computations and applications in Biology, Aerospace, Finance, data acquisition, etc. MATLAB may be used interactively or in batch. In addition, it supports a wide array of graphical applications, ranging from bar charts, line and&#8230;<\/p>\n","protected":false},"author":1692,"featured_media":0,"parent":76567,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/4606"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/1692"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=4606"}],"version-history":[{"count":50,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/4606\/revisions"}],"predecessor-version":[{"id":158986,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/4606\/revisions\/158986"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/76567"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=4606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}