{"id":160,"date":"2018-01-18T20:27:05","date_gmt":"2018-01-18T20:27:05","guid":{"rendered":"https:\/\/in.nau.edu\/hpc\/?page_id=160"},"modified":"2024-08-14T09:53:12","modified_gmt":"2024-08-14T16:53:12","slug":"matlab-jobs","status":"publish","type":"page","link":"https:\/\/in.nau.edu\/arc\/overview\/using-the-cluster-advanced\/matlab-jobs\/","title":{"rendered":"MATLAB Jobs"},"content":{"rendered":"<h1>MATLAB jobs<\/h1>\n<p>In order to run MATLAB on Monsoon,you can either run MATLAB an interactive session or a batch script.<\/p>\n<h3>Interactive Session<\/h3>\n<p>When using Matlab as an interactive session you will need to utilize X11 forwarding in your shell. To learn how to do this, please visit our page on <a href=\"https:\/\/in.nau.edu\/hpc\/x11-forwarding\/\">X11<\/a>. Once this is done, you will be able to run Matlab by executing the following commands:<\/p>\n<p><code><strong> # First, set up your X11 environment\/terminal <\/strong><br \/>\n[abc123@wind ~] module load matlab<br \/>\n[abc123@wind ~] srun --mem=2000 --pty matlab<\/code><\/p>\n<p>This is an example job script for running a non-interactive\/non-gui MATLAB <span style=\"font-size: 16px; font-family: monospace; border: 1px solid; border-radius: 4px; padding: 0px 4px 0px; border-color: #BBBBBB; background-color: white\">.m<\/span> file:<\/p>\n<h3>Batch Script<\/h3>\n<pre><strong>Matlab.sh<\/strong>\r\n<code>#!\/bin\/bash\r\n#SBATCH --job-name=myjob1                    # name of your job within Monsoon\r\n#SBATCH --chdir=\/scratch\/NAUID               # your work directory\r\n#SBATCH --output=\/scratch\/NAUID\/output.txt   # target for text output\/errors\r\n#SBATCH --time=20:00                         # 20 min (max run time)\r\n#SBATCH --mem=2000                           # 2000 megabytes (max available mem)\r\nmodule load matlab\r\nsrun matlab -nodisplay -nodesktop -r \"run \/scratch\/NAUID\/myjob1.m\"<\/code>\r\n<strong>myjob1.m<\/strong>\r\n<code>1+1\r\n1+2^2\r\n3-7<\/code>\r\n<strong>output.txt<\/strong>\r\n<code>&lt; M A T L A B (R) &gt;\r\nCopyright 1984-2019 The MathWorks, Inc.\r\nR2019b (9.7.0.1190202) 64-bit (glnxa64)\r\nAugust 21, 2019\r\nTo get started, type doc.\r\nFor product information, visit www.mathworks.com.\r\nans = 2\r\nans = 5\r\nans = -4\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MATLAB jobs In order to run MATLAB on Monsoon,you can either run MATLAB an interactive session or a batch script. Interactive Session When using Matlab as an interactive session you will need to utilize X11 forwarding in your shell. To learn how to do this, please visit our page on X11. Once this is done, [&hellip;]<\/p>\n","protected":false},"author":76,"featured_media":145,"parent":71,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","ring_central_script_selection":"","footnotes":""},"class_list":["post-160","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/users\/76"}],"replies":[{"embeddable":true,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":6,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages\/160\/revisions"}],"predecessor-version":[{"id":3613,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages\/160\/revisions\/3613"}],"up":[{"embeddable":true,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/pages\/71"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/media\/145"}],"wp:attachment":[{"href":"https:\/\/in.nau.edu\/arc\/wp-json\/wp\/v2\/media?parent=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}