{"id":2671,"date":"2017-06-30T10:13:27","date_gmt":"2017-06-30T10:13:27","guid":{"rendered":"http:\/\/www.raymaps.com\/?p=2671"},"modified":"2017-06-30T17:10:49","modified_gmt":"2017-06-30T17:10:49","slug":"matlab-vs-python-computational-speed","status":"publish","type":"post","link":"https:\/\/www.raymaps.com\/index.php\/matlab-vs-python-computational-speed\/","title":{"rendered":"MATLAB vs Python Computational Speed"},"content":{"rendered":"<p><strong>Windows Edition<\/strong><br \/>\nWindows 8.1 Pro<\/p>\n<p><strong>System<\/strong><br \/>\nProcessor Intel(R) Core(TM) i7-5500U CPU @ 2.4GHz<br \/>\nInstalled Memory 8.00 GB<br \/>\nSystem Type 64 Bit Operating System, x64 Based Processor<\/p>\n<p><strong>Integrated Development Environment (IDE)<\/strong><br \/>\nEnthought Canopy<br \/>\nVersion 2.1.3.3542 (32 bit)<\/p>\n<table style=\"height: 357px;\" width=\"624\">\n<tbody>\n<tr>\n<td width=\"356\"><strong>Operation<\/strong><\/td>\n<td width=\"154\"><strong>Time in sec (MATLAB)<\/strong><\/td>\n<td width=\"154\"><strong>Time in sec (PYTHON)<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"356\">10 million uniform random variable generation<\/td>\n<td width=\"154\">0.10<\/td>\n<td width=\"154\">0.15<\/td>\n<\/tr>\n<tr>\n<td width=\"356\">10 million normal random variable generation<\/td>\n<td width=\"154\">0.13<\/td>\n<td width=\"154\">0.40<\/td>\n<\/tr>\n<tr>\n<td width=\"356\">for loop counting up to 100 million<\/td>\n<td width=\"154\">0.40<\/td>\n<td width=\"154\">11.60<\/td>\n<\/tr>\n<tr>\n<td width=\"356\">Comparing two vectors of length 10 million each<\/td>\n<td width=\"154\">0.39<\/td>\n<td width=\"154\">0.55<\/td>\n<\/tr>\n<tr>\n<td width=\"356\">Plotting a histogram of 10 million values<\/td>\n<td width=\"154\">0.89<\/td>\n<td width=\"154\">0.76<\/td>\n<\/tr>\n<tr>\n<td width=\"356\">Plotting a scatter plot of 1 million values<\/td>\n<td width=\"154\">0.30<\/td>\n<td width=\"154\">0.23<\/td>\n<\/tr>\n<tr>\n<td width=\"356\">Bit error rate calculation of BPSK for 10 values of SNR<\/td>\n<td width=\"154\">2.49<\/td>\n<td width=\"154\">4.51<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\">Although Python is a bit slower than MATLAB for most of the cases but the real difference is in implementation of &#8220;for loop&#8221; where the speed of MATLAB is 29x that of Python. Another surprising result was that the plot functions for Python were somewhat faster than MATLAB.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows Edition Windows 8.1 Pro System Processor Intel(R) Core(TM) i7-5500U CPU @ 2.4GHz Installed Memory 8.00 GB System Type 64 Bit Operating System, x64 Based Processor Integrated Development Environment (IDE) Enthought Canopy Version 2.1.3.3542 (32 bit) Operation Time in sec (MATLAB) Time in sec (PYTHON) 10 million uniform random variable generation 0.10 0.15 10 million normal random variable generation 0.13 0.40 for loop counting up to 100 million 0.40 11.60 Comparing two vectors of length 10 million each 0.39 0.55 Plotting a histogram of 10 million values 0.89 0.76 Plotting a scatter plot of 1 million values 0.30 0.23 Bit [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[81],"tags":[86,134,135],"class_list":["post-2671","post","type-post","status-publish","format-standard","hentry","category-fundamentals","tag-matlab","tag-python","tag-speed"],"_links":{"self":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/2671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/comments?post=2671"}],"version-history":[{"count":6,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/2671\/revisions"}],"predecessor-version":[{"id":2677,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/posts\/2671\/revisions\/2677"}],"wp:attachment":[{"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/media?parent=2671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/categories?post=2671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.raymaps.com\/index.php\/wp-json\/wp\/v2\/tags?post=2671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}