{"id":520,"date":"2012-04-25T14:41:06","date_gmt":"2012-04-25T14:41:06","guid":{"rendered":"http:\/\/azfreeos.wordpress.com\/?p=31"},"modified":"2013-09-27T14:46:48","modified_gmt":"2013-09-27T14:46:48","slug":"draw-2-d-contour-figure-using-octave","status":"publish","type":"post","link":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/2012\/04\/25\/draw-2-d-contour-figure-using-octave\/","title":{"rendered":"Draw 2-D contour figure using Octave"},"content":{"rendered":"<p>Like previous writings, drawing the contours of diffraction wave 2 dimensions by using python. We may also use Octave for drawing contours 2 dimensions of the diffraction of waves propagated through the crack surfaces (example taken), in addition to using Python, Matlab, Scilab, and so on.<\/p>\n<p>The File will be in ASCII format read surely in 2 dimensions (an example file can be downloaded).<\/p>\n<p>File to read it is called &#8220;baca_data.&#8221; m &#8220;. The Script of this file is as follows,<\/p>\n<hr \/>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014- baca_data.m \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p>#! \/usr\/bin\/octave -qf<\/p>\n<p>fid = fopen(\u2019scen-7.pma\u2019,&#8217;r\u2019);<\/p>\n<p>nl = fscanf(fid,\u2019%g %g %g %g %g %g %g %g %gn\u2019,[1 7]);<\/p>\n<p>N = nl(1,1);<\/p>\n<p>M = nl(1,2);<\/p>\n<p>axmin = -2;<\/p>\n<p>axmax =\u00a0 2;<\/p>\n<p>[x y] = meshgrid(0:100,0:100);<\/p>\n<p>b\u00a0 = fscanf(fid,\u2019%e\u2019,[N M]);<\/p>\n<p>caxis([axmin axmax]);<\/p>\n<p>su(x,y,b);<\/p>\n<p>colormap(\u2019jet\u2019);<\/p>\n<p>colorbar;<\/p>\n<p>axis([0, 100, 0, 100],\u201dij\u201d);<\/p>\n<p>print surf_octave.png;<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014- baca_data.m \u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p>When the file is over run with the command,<\/p>\n<p>abuadnan@abuadnan-laptop:~\/Documents$ .\/baca_data.m<\/p>\n<p>Then it will get the file contourf_octave. png as follows,<\/p>\n<p><a href=\"https:\/\/dosen.unila.ac.id\/wp-content\/uploads\/sites\/21\/2012\/04\/contourf_octave.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"https:\/\/dosen.unila.ac.id\/wp-content\/uploads\/sites\/21\/2012\/04\/contourf_octave.png?w=300\" width=\"400\" height=\"300\" border=\"0\" \/><\/a><\/p>\n<div>\n<p style=\"text-align: center\">Figure 1. Contour Image File generated from a script Octave (baca_data.m)<\/p>\n<\/div>\n<p>Figure 1 is a picture generated from a script file with the name Octave &#8220;baca_data m&#8221; run like the procedure above. Where this script reads the data file in ASCII format with the name &#8220;scen-7. foreign direct investment&#8221;. The File is run and the resulting figure 1 above<\/p>\n<p>So, hopefully this is helpful to all users of linux or windows using the Octave as a free program (free softwares). This example File can be downloaded from <a href=\"https:\/\/dosen.unila.ac.id\/wp-content\/uploads\/sites\/21\/2013\/09\/baca_data_2d_octave.zip\" target=\"_blank\">here<\/a> (101,2 Kb)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like previous writings, drawing the contours of diffraction wave 2 dimensions by using python. We may also use Octave for drawing contours 2 dimensions of the diffraction of waves propagated &hellip; <a class=\"readmore\" href=\"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/2012\/04\/25\/draw-2-d-contour-figure-using-octave\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-520","post","type-post","status-publish","format-standard","hentry","category-octave"],"_links":{"self":[{"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/posts\/520"}],"collection":[{"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/comments?post=520"}],"version-history":[{"count":0,"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/posts\/520\/revisions"}],"wp:attachment":[{"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/media?parent=520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/categories?post=520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dosen.unila.ac.id\/ahmadzakaria\/wp-json\/wp\/v2\/tags?post=520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}